ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel macro problem cursor down (https://www.excelbanter.com/excel-programming/296209-excel-macro-problem-cursor-down.html)

jos

Excel macro problem cursor down
 
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

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Excel macro problem cursor down
 
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)

"jos " wrote in message
...
to make a datarange variable in a macro, I need to put the command
"down" (cursor one or more steps down). I can not find the exact
command phrase.


---
Message posted from http://www.ExcelForum.com/




Tom Ogilvy

Excel macro problem cursor down
 
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)

--
Regards,
Tom Ogilvy

"jos " wrote in message
...
to make a datarange variable in a macro, I need to put the command
"down" (cursor one or more steps down). I can not find the exact
command phrase.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 11:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com