variable range automation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two identical tables side by side and I'm trying to use one line of
code to create a chart for both tables. How do I write a variable range?

My code is as follows:

If intColumns = 0 Then
ActiveChart.SetSourceData Source:=Sheets("cbot").Range("A2:E30"),
PlotBy:= _
xlColumns
Else
ActiveChart.SetSourceData Source:=Sheets("cbot").Range("I2:M30"),
PlotBy:= _
xlColumns
End If
 
Back
Top