Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey,
I'm trying to select the next cell down, just like you would if you used the up and down keys on your keyboard. What code could I use? I tried this already but it doesn't work: Range("B3").Activate ActiveCell.Next(x1Down).Select Any suggestions? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Try: ActiveCell.Offset(1, 0).Select -- Regards, Sébastien <http://www.ondemandanalysis.com "Gabe" wrote: Hey, I'm trying to select the next cell down, just like you would if you used the up and down keys on your keyboard. What code could I use? I tried this already but it doesn't work: Range("B3").Activate ActiveCell.Next(x1Down).Select Any suggestions? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Alright this is about to get complicated so bear with me,
The reason I need it to do exactely what the arrow keys do is because, I have grouped cells B4:B9. If I use the arrow keys, excel automatically goes from B3 to B10. So you see the offset command won't work! Now what!? "sebastienm" wrote: Hi Try: ActiveCell.Offset(1, 0).Select -- Regards, Sébastien <http://www.ondemandanalysis.com "Gabe" wrote: Hey, I'm trying to select the next cell down, just like you would if you used the up and down keys on your keyboard. What code could I use? I tried this already but it doesn't work: Range("B3").Activate ActiveCell.Next(x1Down).Select Any suggestions? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I see. What about:
Range("B3").Activate Application.SendKeys "{DOWN}" Probably not the best to use SendKeys, but depending on what your overall process is, it could be just working fine. -- Regards, Sébastien <http://www.ondemandanalysis.com "Gabe" wrote: Alright this is about to get complicated so bear with me, The reason I need it to do exactely what the arrow keys do is because, I have grouped cells B4:B9. If I use the arrow keys, excel automatically goes from B3 to B10. So you see the offset command won't work! Now what!? "sebastienm" wrote: Hi Try: ActiveCell.Offset(1, 0).Select -- Regards, Sébastien <http://www.ondemandanalysis.com "Gabe" wrote: Hey, I'm trying to select the next cell down, just like you would if you used the up and down keys on your keyboard. What code could I use? I tried this already but it doesn't work: Range("B3").Activate ActiveCell.Next(x1Down).Select Any suggestions? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try selection.offset(1,0).select
or activecell.offset(1,0).select or range("B1").select or [b1].select or .offset(1,0). means 1 cell down or .offset(0,1). means 1 cell right or .offset(-1,0). means 1 cell up or .offset(0,-1). means 1 cell left "Gabe" wrote in message ... Hey, I'm trying to select the next cell down, just like you would if you used the up and down keys on your keyboard. What code could I use? I tried this already but it doesn't work: Range("B3").Activate ActiveCell.Next(x1Down).Select Any suggestions? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I copied the example you wrote but it's not working, is there something I
have to change in the example first? "sebastienm" wrote: I see. What about: Range("B3").Activate Application.SendKeys "{DOWN}" Probably not the best to use SendKeys, but depending on what your overall process is, it could be just working fine. -- Regards, Sébastien <http://www.ondemandanalysis.com "Gabe" wrote: Alright this is about to get complicated so bear with me, The reason I need it to do exactely what the arrow keys do is because, I have grouped cells B4:B9. If I use the arrow keys, excel automatically goes from B3 to B10. So you see the offset command won't work! Now what!? "sebastienm" wrote: Hi Try: ActiveCell.Offset(1, 0).Select -- Regards, Sébastien <http://www.ondemandanalysis.com "Gabe" wrote: Hey, I'm trying to select the next cell down, just like you would if you used the up and down keys on your keyboard. What code could I use? I tried this already but it doesn't work: Range("B3").Activate ActiveCell.Next(x1Down).Select Any suggestions? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hmm ... no.
- what is the selected cell before you run the macro - what is the selected cell after you run the macro (it should ebnd up is B4) -- Regards, Sébastien <http://www.ondemandanalysis.com "Gabe" wrote: I copied the example you wrote but it's not working, is there something I have to change in the example first? "sebastienm" wrote: I see. What about: Range("B3").Activate Application.SendKeys "{DOWN}" Probably not the best to use SendKeys, but depending on what your overall process is, it could be just working fine. -- Regards, Sébastien <http://www.ondemandanalysis.com |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
B3 befroe I run it, B3 after I run it.
"sebastienm" wrote: hmm ... no. - what is the selected cell before you run the macro - what is the selected cell after you run the macro (it should ebnd up is B4) -- Regards, Sébastien <http://www.ondemandanalysis.com "Gabe" wrote: I copied the example you wrote but it's not working, is there something I have to change in the example first? "sebastienm" wrote: I see. What about: Range("B3").Activate Application.SendKeys "{DOWN}" Probably not the best to use SendKeys, but depending on what your overall process is, it could be just working fine. -- Regards, Sébastien <http://www.ondemandanalysis.com |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oh I get it!, I had to create a command button in excelassign the
macroclose VBAthen run it from excel. Before I was in VBA jusk clicking the F8 button through each step. Cool thanks sebastien for your help. "Gabe" wrote: B3 befroe I run it, B3 after I run it. "sebastienm" wrote: hmm ... no. - what is the selected cell before you run the macro - what is the selected cell after you run the macro (it should ebnd up is B4) -- Regards, Sébastien <http://www.ondemandanalysis.com "Gabe" wrote: I copied the example you wrote but it's not working, is there something I have to change in the example first? "sebastienm" wrote: I see. What about: Range("B3").Activate Application.SendKeys "{DOWN}" Probably not the best to use SendKeys, but depending on what your overall process is, it could be just working fine. -- Regards, Sébastien <http://www.ondemandanalysis.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting multiple cells, I can't see the cells highlighted | Excel Discussion (Misc queries) | |||
How to change shade of cells when selecting multiple cells | Excel Discussion (Misc queries) | |||
By selecting cells adjacent to cells tally sheet | Excel Worksheet Functions | |||
Selecting 2 cells together | Excel Programming | |||
selecting cells | Excel Programming |