+ Reply to Thread
Results 1 to 5 of 5

How do you select a multipage tab without a mouse click?

  1. #1
    Registered User
    Join Date
    11-14-2012
    Location
    Lebanon, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    47

    How do you select a multipage tab without a mouse click?

    I have a userform that has a multipage with two tabs.

    I have set the TabIndex of all of the controls on the userfrom. given the layout of each tab the userform is coded to change size depending on the tab selected. (this works with a mouse click)

    If the user cycles through the controls with tab key and highlights the multipage tab and then presses the arrow key to change the tab the userform does not change size.

    How do I trap for the arrow keys if one of the multipage tabs has been highlighted?

    I want to run my sizing code if the user has highlighted the multipage tab and then pressed the left or right arrow keys.

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: How do you select a multipage tab without a mouse click?

    Why do you not add scrollbar to page with more controls?

    Which event do you use to resize form - Multipage Change?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Registered User
    Join Date
    11-14-2012
    Location
    Lebanon, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: How do you select a multipage tab without a mouse click?

    I suppose I could add a scrollbar.
    The reason I didn't is because I have a listbox near the top of the second page and a series of textbox fields below where the user adds data, and the user needs to see the listbox.
    I could also just size my userform for the larger page, but there would be a lot of empty space on the first page if I do that, and it just doesn't look good.

    I am using a change even to check for a mouse click on the multipage tabs.

    from the userform code
    Please Login or Register  to view this content.
    module code
    Please Login or Register  to view this content.
    The custom variables used on the page1 case are set at the userform initialize

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: How do you select a multipage tab without a mouse click?

    I think you only have to switch from Click event to Change event for Multipage control:
    Please Login or Register  to view this content.
    module code:
    Please Login or Register  to view this content.
    I would put all code in userform module.

  5. #5
    Registered User
    Join Date
    11-14-2012
    Location
    Lebanon, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: How do you select a multipage tab without a mouse click?

    Using the change event works!!!
    The userform now changes size if you arrow left or right.

    I had to change the userform code. You forgot to make it a change event.
    Please Login or Register  to view this content.
    Thank you very much for your help with this problem.
    I had tried a change even but it would not work. After looking at your code I realized that I was not passing any values to "SetUserFromSize" when I originally tried the change event.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 03-06-2013, 12:52 PM
  2. [SOLVED] Select the cell with the click of a mouse, and have the result of calculation
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-03-2012, 06:26 AM
  3. Prevent ListBox Click Event Until Mouse Click
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2011, 12:23 PM
  4. vba code for moving the cursor/right click/left click of the mouse?
    By yellowpower in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2010, 10:07 AM
  5. How to select a line in Listbox with the duble click with the mouse
    By olio39 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2007, 08:05 AM

Tags for this Thread

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