I can use ranges for variable rows, but cannot figure out how to use variable columns.
For variable rows, I use:
lastrow = Range("b65536").End(xlUp).Row
Range("B11:H" & lastrow).Select
I am trying to set the data for a graph using a variable number of columns
using this form:
lastcol = Cells(2, 256).End(xlToLeft).Column
but this errors out:
mydataRange = Range(Cells(2, 22), Cells(3, lastcol))
I have tried Set command, no luck.
For variable rows, I use:
lastrow = Range("b65536").End(xlUp).Row
Range("B11:H" & lastrow).Select
I am trying to set the data for a graph using a variable number of columns
using this form:
lastcol = Cells(2, 256).End(xlToLeft).Column
but this errors out:
mydataRange = Range(Cells(2, 22), Cells(3, lastcol))
I have tried Set command, no luck.