Use variable to reference a range?

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
 
R

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top