+ Reply to Thread
Results 1 to 5 of 5

Populate userform radio (option) buttons based on data in worksheet

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    Calgary, Alberta
    MS-Off Ver
    Office2011 (Mac)
    Posts
    16

    Populate userform radio (option) buttons based on data in worksheet

    Hi everybody.

    I have a worksheet with row entries of client profile information. In order to protect the data from user error, a Userform is used to edit the client's contact information. By clicking on a button, "Edit Client", an Input box is loaded asking the user what client ID# they wish to edit. This number input is put into a textbox on the userform, and all the textboxes and radio buttons on the userform are populated by referencing the Row# that the Client ID# appears on in the worksheet.

    Currently, all the textboxes are populating perfectly. However, the radio button selections are not populating correctly. When the userform initializes, the radio buttons will not populate. BUT... BUT... I have a command to re-initialize the userform if the Client ID# is changed on the userform, and if that is triggered the radio buttons populate correctly.

    I have been scratching my head why and I can't see what the problem is. So, I am reaching out to see if anybody else has had this problem, or can offer a solution.

    Anybody have any insight?

    Code:

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Populate userform radio (option) buttons based on data in worksheet

    I'm assuming the Prefix buttons are the option buttons in question?

    You would only have to set one option button to true. The others will automatically set to false as is the nature of grouped option buttons.

    Try something like this.

    The LCase function makes it case insensitive e.g., Mr. = MR.

    If you're missing a period, it's not a match e.g., Mr <> Mr.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-16-2012
    Location
    Calgary, Alberta
    MS-Off Ver
    Office2011 (Mac)
    Posts
    16

    Re: Populate userform radio (option) buttons based on data in worksheet

    Ah, brilliant. Select Case, a much better approach! Thank you for the insight.

    I will try this in the morning and update the thread with a result and comment.

    Much appreciated!

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Populate userform radio (option) buttons based on data in worksheet

    This is a little more robust. The period is now optional e.g., Mr = Mr.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-16-2012
    Location
    Calgary, Alberta
    MS-Off Ver
    Office2011 (Mac)
    Posts
    16

    Re: Populate userform radio (option) buttons based on data in worksheet

    Worked perfectly. I will apply this technique to other userforms as well. Thank you very much!!

+ 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. userform with 6 option buttons to populate 1 listbox
    By simeonmein in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 05:18 PM
  2. How can I insert multiple sets of option buttons (radio buttons) in Excel 2010?
    By mickwooduclan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2013, 10:01 AM
  3. Excel 2007 : Help with option/radio buttons
    By Twilock in forum Excel General
    Replies: 0
    Last Post: 07-12-2012, 09:14 PM
  4. Evaluation with Radio buttons and Option buttons
    By soph0101 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-15-2010, 12:23 PM
  5. [SOLVED] Grouping radio option buttons
    By ahmed in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2006, 06:15 PM

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