+ Reply to Thread
Results 1 to 3 of 3

VB TAB doesn't move activecell??

  1. #1
    Ben W
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    Harald Staff
    Guest

    Re: 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" <[email protected]> skrev i melding
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1