Limited VBA conceptual understanding. Using Excel 2010 Binary file type. Attempting to modify three simple graphs (on same worksheet) by overriding scale minimums and maximums with cell references in same worksheet. Unfortunately, I am getting a VBA error that I have done some limited research and could not determine a fix.
Current VBA code within worksheet:
Private Sub Worksheet_Calculate()
Dim wb As Workbook
Dim ws As Object
Set wb = ThisWorkbook
Set ws = Sheet1("Coll_Efficiency")
With Chart7.Axes(xlValue)
.MinimumScale = Range("g1")
.MaximumScale = Range("f1")
End With
With Chart8.Axes(xlValue)
.MinimumScale = Range("i1")
.MaximumScale = Range("h1")
End With
With Chart9.Axes(xlValue)
.MinimumScale = Range("k1")
.MaximumScale = Range("j1")
End With
End Sub
Any insight would be appreciated. TIA!
Current VBA code within worksheet:
Private Sub Worksheet_Calculate()
Dim wb As Workbook
Dim ws As Object
Set wb = ThisWorkbook
Set ws = Sheet1("Coll_Efficiency")
With Chart7.Axes(xlValue)
.MinimumScale = Range("g1")
.MaximumScale = Range("f1")
End With
With Chart8.Axes(xlValue)
.MinimumScale = Range("i1")
.MaximumScale = Range("h1")
End With
With Chart9.Axes(xlValue)
.MinimumScale = Range("k1")
.MaximumScale = Range("j1")
End With
End Sub
Any insight would be appreciated. TIA!