Excel macro problem cursor down

J

jos

to make a datarange variable in a macro, I need to put the comman
"down" (cursor one or more steps down). I can not find the exac
command phrase
 
B

Bob Phillips

Your question is none too clear, but it might be that resize will help you.
For instance

Set myRange = Range("A1").Resize(10,5)

will create a range variable that is 10 rows and 5 columns in
dimension.Obviously you could have variable to calculate the rows and
columns and plug them into that code..

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
T

Tom Ogilvy

Dim rng as Range
set rng = Range(Activecell,ActiveCell.end(xldown))

rng.name = "Datarange"


or

set rng = ActiveCell.End(xldown)

or

set rng = Range("A1").End(xldown)
 
Top