hi, thank you, i'm total new to this stuff so this is my code
Private Sub btnGo_Click()
Dim startDate As String
Dim endDate As String
Dim outputType As String
Dim accumulation As Integer
' validate cells
startDate = Format(Worksheets("Energy Report").Range("B1"), "YYYY-MM-DD")
endDate = Format(Worksheets("Energy Report").Range("B2"), "YYYY-MM-DD")
outputType = Worksheets("Energy Report").Range("B3")
If Target.Address = "$B$3" = "dollars" Then
ActiveSheet.Shapes(0).Select
ActiveChart.HasTitle = True
ActiveChart.ChartTitle.Text = "this is the chart for dollars"
Else
ActiveChart.ChartTitle.Text = "this is the chart for kWhs"
End If
' If (Worksheets("Energy Report").Range("B3") = "dollars") Then
'
' Worksheets("Energy Report").Range("C3") = "this is the chart for dollars"
' Else
' Worksheets("Energy Report").Range("C3") = "this is the chart for dollars"
'
' End If
pricePerkWh = Worksheets("Energy Report").Range("B4")
If (Worksheets("Energy Report").Range("B5") = "yes") Then
accumulation = 1
Else
accumulation = 0
End If
but it's a runtime error, what do i do wrong?