Changing chart title with vba
hi
i want to change the chart title of a chart title by using vba if the name of a certain cell gets a certain value thats my code:
Code:
Dim outputType As String
Dim oCT As ChartTitle
If (Worksheets("Energy Report").Range("B3") = "Cat") Then
Charts(1).HasTitle = True
Set oCT = Charts(1).ChartTitle
With oCT
.Caption = Sheets("Test").Range("B3").Value
End With
End If
so what i want is i want that if someone types "Cat" in cell b3 the Charttitle should change into "Test", how do i do that or what did i do wrong,
thanks for your advise