I have a series of VBA codes written in Excel to update a number of graphs. However, one section of code is returning the graph results for the code directly preceding it. Here is the code in question -
Code:
Sheets("Monthly SuperMetrics Data").Select
Cells(4, 1).Select
Do Until Selection = ""
If Selection = "% of Total VDP Views for New Vehicles" Then
varRow = ActiveCell.Row
End If
Selection.Offset(1, 0).Select
Loop
stringvariable = Trim(Str(varRow))
ChartRange = RangeStart + "3:" + RangeEnd + "3," + RangeStart + stringvariable + ":" + RangeEnd + stringvariable
Sheets("SuperMetrics Graphing").Select
ActiveSheet.ChartObjects("Chart 69").Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("Monthly SuperMetrics Data").Range(ChartRange), PlotBy:=xlRows ActiveChart.Location Where:=xlLocationAsObject, Name:= _
"SuperMetrics Graphing"
ActiveChart.HasDataTable = False
Comment