Hi there,
I've got various different charts on a sheet. I am looking for a Macro to automatically adjust the maximum and minimum scale of the axis as well as the point where the horizontal axis crosses. The macro I am working with is (just for two graphs for the sake of this example)
Sub ejesautomaticos()
With ActiveSheet.ChartObjects("BFRTC").Chart
.Axes(xlValue).MinimumScale = Range("'Average'!AM85").Value
.Axes(xlValue).MaximumScale = Range("'Average'!AM86").Value
.Axes(xlValue).CrossesAt = Range("'Average'!AN86").Value
End With
With ActiveSheet.ChartObjects("VLLTC").Chart
.Axes(xlValue).MinimumScale = Range("'Average'!N85").Value
.Axes(xlValue).MaximumScale = Range("'Average'!N86").Value
.Axes(xlValue).CrossesAt = Range("'Average'!085").Value
End With
End Sub
I am getting and error on this line:
.Axes(xlValue).CrossesAt = Range("'Average'!AN86").Value
What should I do get around the error?
Thanks
Josedv
I've got various different charts on a sheet. I am looking for a Macro to automatically adjust the maximum and minimum scale of the axis as well as the point where the horizontal axis crosses. The macro I am working with is (just for two graphs for the sake of this example)
Sub ejesautomaticos()
With ActiveSheet.ChartObjects("BFRTC").Chart
.Axes(xlValue).MinimumScale = Range("'Average'!AM85").Value
.Axes(xlValue).MaximumScale = Range("'Average'!AM86").Value
.Axes(xlValue).CrossesAt = Range("'Average'!AN86").Value
End With
With ActiveSheet.ChartObjects("VLLTC").Chart
.Axes(xlValue).MinimumScale = Range("'Average'!N85").Value
.Axes(xlValue).MaximumScale = Range("'Average'!N86").Value
.Axes(xlValue).CrossesAt = Range("'Average'!085").Value
End With
End Sub
I am getting and error on this line:
.Axes(xlValue).CrossesAt = Range("'Average'!AN86").Value
What should I do get around the error?
Thanks
Josedv