Is it possible to define a range in VBA based on a value given in a cell?
For example, I have a dataset with four columns and a constantly changing number of rows. I have the number of rows in cell F2
. Suppose cell F2
indicates the number of rows is 385
, then I be able to Range("A1:D385").Select
, but I want the selection of the last cell to be dependent on cell F2
.
So if I change F2
to 50
, that the next time I run the macro, A1:D50
will be selected, but since I'm new to VBA I can't figure it out.