Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code to move cursor 'one cell down?
I have a macro in an Excel worksheet that just needs one step added,
to move the cursor one cell down from its current position. Can someone tell me what the code for that would be? When I add record the keystroke via moving the down arrow one cell down, it actually adds the cell reference, which is no good. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code to move cursor 'one cell down?
Activecell.Offset(1,0).Select -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "StargateFan" wrote in message ... I have a macro in an Excel worksheet that just needs one step added, to move the cursor one cell down from its current position. Can someone tell me what the code for that would be? When I add record the keystroke via moving the down arrow one cell down, it actually adds the cell reference, which is no good. Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code to move cursor 'one cell down?
On Thu, 20 May 2004 11:06:05 +0100, "Bob Phillips"
wrote: Activecell.Offset(1,0).Select Glorious! My macro works perfectly now! Thank you! -- HTH It sure did! I know have a spreadsheet that has buttons with macros assigned to them that are found in the workbook itself, all of which has allowed me to put some great db-like functionality into a spreadsheet! I just earned my pay! I found out this weekend about how to do all of this. For years I've been assigning macros to the toolbar but not making standalone files in this way. Excel is one of the few programs, like WordPerfect, that has never let me down all these years. No matter what I've needed, it's come through! Awesome! :oD Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "StargateFan" wrote in message .. . I have a macro in an Excel worksheet that just needs one step added, to move the cursor one cell down from its current position. Can someone tell me what the code for that would be? When I add record the keystroke via moving the down arrow one cell down, it actually adds the cell reference, which is no good. Thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code to move cursor 'one cell down?
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. StargateFan wrote: I have a macro in an Excel worksheet that just needs one step added, to move the cursor one cell down from its current position. Can someone tell me what the code for that would be? When I add record the keystroke via moving the down arrow one cell down, it actually adds the cell reference, which is no good. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code to move cursor 'one cell down?
On Thu, 20 May 2004 07:53:55 -0400, 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. Thank you! I appreciate learning this! I'm finally getting a bit into macro recording. And this will be of great help! I think what stopped me from getting into this earlier is that in the 16bit days, the recorded macros didn't work in Excel and Word the way they did in other programs. I never had luck in getting what I needed (and it was prior 1999, when I first got online at home and then got into ngs!). Now I find that it does a great job, just like all other programs do. It's really opened things up for me in last year ever since I started tentatively exploring VB-based macros (not the easiest scripting language to get into even with years of experience in others <lol!) :oD StargateFan wrote: I have a macro in an Excel worksheet that just needs one step added, to move the cursor one cell down from its current position. Can someone tell me what the code for that would be? When I add record the keystroke via moving the down arrow one cell down, it actually adds the cell reference, which is no good. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code to move cursor 'one cell down?
You're welcome! The macro recorder doesn't produce the most efficient
code, but it's a good way to learn about the Excel object model. Also, David McRitchie has a list of VBA tutorials that may interest you: http://www.mvps.org/dmcritchie/excel...m#vbatutorials StargateFan wrote: On Thu, 20 May 2004 07:53:55 -0400, 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. Thank you! I appreciate learning this! I'm finally getting a bit into macro recording. And this will be of great help! I think what stopped me from getting into this earlier is that in the 16bit days, the recorded macros didn't work in Excel and Word the way they did in other programs. I never had luck in getting what I needed (and it was prior 1999, when I first got online at home and then got into ngs!). Now I find that it does a great job, just like all other programs do. It's really opened things up for me in last year ever since I started tentatively exploring VB-based macros (not the easiest scripting language to get into even with years of experience in others <lol!) :oD StargateFan wrote: I have a macro in an Excel worksheet that just needs one step added, to move the cursor one cell down from its current position. Can someone tell me what the code for that would be? When I add record the keystroke via moving the down arrow one cell down, it actually adds the cell reference, which is no good. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB code to move cursor 'one cell down?
On Thu, 20 May 2004 08:11:52 -0400, Debra Dalgleish
wrote: You're welcome! The macro recorder doesn't produce the most efficient code, but it's a good way to learn about the Excel object model. Also, David McRitchie has a list of VBA tutorials that may interest you: http://www.mvps.org/dmcritchie/excel...m#vbatutorials Thank you so much for this! As a PSP/Bryce/Poser user, I'm very keen on tutorials!! <lol One always learns a lot from them. StargateFan wrote: On Thu, 20 May 2004 07:53:55 -0400, 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. Thank you! I appreciate learning this! I'm finally getting a bit into macro recording. And this will be of great help! I think what stopped me from getting into this earlier is that in the 16bit days, the recorded macros didn't work in Excel and Word the way they did in other programs. I never had luck in getting what I needed (and it was prior 1999, when I first got online at home and then got into ngs!). Now I find that it does a great job, just like all other programs do. It's really opened things up for me in last year ever since I started tentatively exploring VB-based macros (not the easiest scripting language to get into even with years of experience in others <lol!) :oD StargateFan wrote: I have a macro in an Excel worksheet that just needs one step added, to move the cursor one cell down from its current position. Can someone tell me what the code for that would be? When I add record the keystroke via moving the down arrow one cell down, it actually adds the cell reference, which is no good. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to move cursor one cell right | New Users to Excel | |||
Move cursor to...on exiting cell | Excel Discussion (Misc queries) | |||
Automatically move cursor when cell value changes | New Users to Excel | |||
Automatically move cursor when cell value changes | New Users to Excel | |||
How do I get tab to move the cursor one cell over rather than 8? | Excel Worksheet Functions |