Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB TAB doesn't move activecell??
Hi,
I'm using the SendKeys ["{tab}"] command in Excel 97 VB. The problem I have is that the activecell doesn't move accross with cursor, it stays on the same cell. For example if my cursor is on cell A1 and I press tab, I move to cell B1 and that's my new active cell. If I do the same but using VB and the SendKeys ["{tab}"] command, the cursor moves but my activecell remains as A1. I can't use an offset as my cursor may need to go down instead of accross depending on what I've selected. That's why I'm using the TAB command as it will only go through the selection I've highlighted. I would appreciate any help!! Thanks in anticipation, Ben |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB TAB doesn't move activecell??
Possibly
Sub tester1() For Each cell In Selection cell.Activate Next End Sub depends on what you are doing. -- Regards, Tom Ogilvy "Ben W" wrote in message om... Hi, I'm using the SendKeys ["{tab}"] command in Excel 97 VB. The problem I have is that the activecell doesn't move accross with cursor, it stays on the same cell. For example if my cursor is on cell A1 and I press tab, I move to cell B1 and that's my new active cell. If I do the same but using VB and the SendKeys ["{tab}"] command, the cursor moves but my activecell remains as A1. I can't use an offset as my cursor may need to go down instead of accross depending on what I've selected. That's why I'm using the TAB command as it will only go through the selection I've highlighted. I would appreciate any help!! Thanks in anticipation, Ben |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB TAB doesn't move activecell??
Hi Ben
SendKeys is very very vulnerable. See if you can use one of these: Sub GoNext() ActiveCell.Next.Activate End Sub Sub GoDown() ActiveCell.Offset(1, 0).Activate End Sub HTH. Best wishes Harald "Ben W" skrev i melding om... Hi, I'm using the SendKeys ["{tab}"] command in Excel 97 VB. The problem I have is that the activecell doesn't move accross with cursor, it stays on the same cell. For example if my cursor is on cell A1 and I press tab, I move to cell B1 and that's my new active cell. If I do the same but using VB and the SendKeys ["{tab}"] command, the cursor moves but my activecell remains as A1. I can't use an offset as my cursor may need to go down instead of accross depending on what I've selected. That's why I'm using the TAB command as it will only go through the selection I've highlighted. I would appreciate any help!! Thanks in anticipation, Ben |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
activecell | Excel Programming | |||
Move ActiveCell down 12 then add up 11 above.... | Excel Programming | |||
use of activecell | Excel Programming | |||
Activecell value | Excel Programming |