+ Reply to Thread
Results 1 to 4 of 4

user form tab index and sort code for sheet 1

  1. #1
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    user form tab index and sort code for sheet 1

    Hi there just a couple of questions.

    On the attached spreadsheet I am looking for code to change the tab index on userform1. Basically if optionbutton1 = true then I would like to tab through CB3 then CB4 then TB3 then commandbutton 1 not optionbutton 2, 3, 4 and then command buttton 1.

    Likewise if option button 2 is selected i would like to tab through CB3, CB4, TB3, CB5,CB6, TB4 then commandbutton1 not CB3, CB4, TB3, CB5,CB6, TB4, OB3, OB4 Command button1.

    Think you get the idea from this.

    Also with this userform is there anyway to adjust the size of the userform depending on which option button is selected? So that it wont leave a large blank area if only 1 is selected?

    Finally is it possible to add some code to commandbutton1 so that after an entry has been made to sheet 1 (products) it will put all the products in sheet 1 in alphabetical order?

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: user form tab index and sort code for sheet 1

    Hi - the option buttons have a tabindex property, if you set this to something high (e.g. 100, 101, 102 for option 2, 3) then you will tab though the comboboxes and textboxes first.

    You can adjust the userform height with the .height property of the userform and then the position of your command button using it's .top property.

  3. #3
    Registered User
    Join Date
    03-22-2013
    Location
    West Sussex
    MS-Off Ver
    Office 365
    Posts
    84

    Re: user form tab index and sort code for sheet 1

    Thanks for your advice. I understand these tab index but I still want to be able to tab through the optionbuttons so I can activate them with a space bar not have to use a mouse which is why I was looking for an If code so that if optionbutton1 was true then it would put the commandbuttons tab index lower?

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: user form tab index and sort code for sheet 1

    You can renumber the tabindex by code, so you would have something like:
    Please Login or Register  to view this content.

+ 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. How to select one or more columns to sort by using user form input
    By bob33 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2013, 10:03 AM
  2. Replies: 2
    Last Post: 04-27-2012, 01:30 AM
  3. [SOLVED] user form-vba code
    By Jay Trull in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2006, 02:50 AM
  4. [SOLVED] Setting the page index in a mulipage user form
    By Trefor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2006, 09:10 AM
  5. user form code
    By static69 in forum Excel General
    Replies: 2
    Last Post: 02-05-2005, 04:31 AM

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