In the code below, why do I keep getting an Object required error?
It happens on the Set CellChange below. Isn't my syntax correct?
It happens on the Set CellChange below. Isn't my syntax correct?
Code:
Option Explicit
Sub Worksheet_Calculcate()
Dim objCht As ChartObject
Dim CellChange As Long
[B][COLOR=#ff0000]Set CellChange [/COLOR][/B]= Sheets("Price Bridge Chart").Range(2, "D").Value
For Each objCht In Sheets("Price Bridge Chart").ChartObjects
With objCht.Chart
' Value (Y) Axis
With .Axes(xlValue)
.MaximumScale = ActiveSheet.Range("$L$34").Value + 500000 + CellChange.Value
.MinimumScale = ActiveSheet.Range("$K$34").Value - 500000
.MajorUnit = 500000 'Chart horizontal lines
End With
End With
Next objCht
End Sub