Use variable to reference a range?

  • Thread starter Thread starter RITCHI
  • Start date Start date
R

RITCHI

Hi

Is it possible to use a variable as part of a range reference?
In the example below I want to change the value 6000 to a different
value that changes from time to time. Can I substitute 6000 for x, y
z etc.
Range("d4:d6000").Value = 1

Any help would be gratefully received.

Thanks

Ritchi
 
Thanks Tom

Just the job.

Regards
Ritchi


Tom said:
Dim x as Long
x = 6000
Range("D4:D" & x).Value = 1


y = 4
z = 4
x = 6000
Cells(y,z).Resize(x,1).Value = 1

Cells(row, column)
 
Back
Top