VB command to move down one row
Hiya,
I've just found this code & it works perfectly for me as is, but just as a point of understanding & learning, the bit at the end: Range("A1").Select Why is this needed? Looking at it, it makes me think that cell A1 will be selected again, which of course it isn't, so what does it do? Thanks merry_fay "Debra Dalgleish" wrote: When you record a macro, turn on Relative Reference to record cell selection by position, instead of a specific cell address. For example, select cell D2, and start recording. Press the Relative Reference button on the Stop Recording toolbar Press the down arrow key Turn off Relative Reference, and stop recording The resulting code is: ActiveCell.Offset(1, 0).Range("A1").Select When you run this code, it will move one cell down from whatever is the active cell. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html " wrote: Help! Is there a command to move down one row regardless of where you are in the spreadsheet? When I use the autorecord, VB selects a specific cell. Using Selection.End(xlDown).Select sequentially drops it all the way to the last two. Help! |
All times are GMT +1. The time now is 10:53 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com