VBA - Axis Option
Solved
zivodul8
Posted messages
248
Status
Member
-
zivodul8 Posted messages 248 Status Member -
zivodul8 Posted messages 248 Status Member -
Hello,
I would like to know the VBA code that allows you to set the value at which the vertical axis crosses the horizontal axis in a chart (and vice versa)?
It's easy to do manually, but in VBA...
Thank you very much!
P.S.: I would also appreciate the code for the minimum and maximum of the axes :)
I would like to know the VBA code that allows you to set the value at which the vertical axis crosses the horizontal axis in a chart (and vice versa)?
It's easy to do manually, but in VBA...
Thank you very much!
P.S.: I would also appreciate the code for the minimum and maximum of the axes :)
2 answers
Hello
for a scatter plot
but the easiest way is to use the macro editor
Tools/macros/new macro
you execute your changes
Tools/macros/stop recording
and you modify the code
have a good continuation
for a scatter plot
With Sheets(1).ChartObjects(1).Chart.Axes(xlCategory) .MinimumScale = -5 .MaximumScale = 12 .Crosses = xlCustom .CrossesAt = -3 End With With Sheets(1).ChartObjects(1).Chart.Axes(xlValue) .MinimumScale = -2 .MaximumScale = 30 .Crosses = xlCustom .CrossesAt = -1 End With
but the easiest way is to use the macro editor
Tools/macros/new macro
you execute your changes
Tools/macros/stop recording
and you modify the code
have a good continuation