View Single Post
  #1   Report Post  
Ryan Proudfit
 
Posts: n/a
Default variable range automation

I have two identical tables side by side and I'm trying to use one line of
code to work 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


--
Ryan Proudfit