VB TAB doesn't move activecell??

  • Thread starter Thread starter Ben W
  • Start date Start date
B

Ben W

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
 
Possibly

Sub tester1()
For Each cell In Selection
cell.Activate
Next
End Sub

depends on what you are doing.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top