+ Reply to Thread
Results 1 to 5 of 5

Focus on Command Button with Tab

  1. #1
    Registered User
    Join Date
    05-04-2010
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    3

    Focus on Command Button with Tab

    Hi all,

    New to VBA. I've been struggling for days trying to figure out how to navigate from cell G4 to focus on a comand button using only the tab button. Can this be done? Very easy in access, thought it would be just as easy in excel (2003).
    Thanks

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: Focus on Command Button with Tab

    Quote Originally Posted by ronjwil View Post
    Very easy in access,
    Really? How do you navigate from a table to a button in Access using the tab key?

    There isn't really a great way - you would have to use the SelectionChange event of the worksheet, keep a record of the last cell selected and then if it was G4, set focus to the button. This would mean though, that you would not be able to select G4 and then click somewhere else in the sheet.
    I'd stick to using a shortcut key for the button, personally.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    05-04-2010
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Focus on Command Button with Tab

    Okay, true. Not easy from a table! Point taken. Can you tell me how to assign a shortcut? I dont see the option in the properties menu.
    Thanks for responding.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: Focus on Command Button with Tab

    It's the Accelerator property. Whatever letter you enter will be underlined in the caption, and pressing Alt+letter will execute the command button.

  5. #5
    Registered User
    Join Date
    05-04-2010
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Focus on Command Button with Tab

    The site is invaluable when trying to pick this stuff up. Thanks for sharing your knowledge.

+ 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