Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Aug 2001
    Location
    Boston, Massachusetts, USA
    Posts
    167
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Formula in UserForms (2003)

    I've already tried a search and came up with nothing. I am developing my 1st UserForm. When the user checks on the box in the spreadsheet, it will pull up the UF. Within the UF, the user will have 3 questions to answer. I want to edit what is available in questions 2 and 3 based on the response to one. E.g. User chooses what group they are working for in question 1. Depending on the answer, a different list should become available in questions 2 and 3. I know that I can do this within the spreadsheets based on IF formulas, but those are based on cell links. Can I use the same theory within a UF? If so and I don't have cell links, how do I build the formulas?
    thanks
    christine

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Formula in UserForms (2003)

    <P ID="edit" class=small>(Edited by sdckapr on 08-Sep-05 15:33. Added PS)</P>The IFs would be in code, though if you have set selections the "Select Case" may be a better setup.

    We could provide a more detailed example if you provided more info about what your setup was like.

    Steve

    PS Ozgrid has an example workbook in Matching ComboBox Controls. Dependent Lists for Combobox Controls

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formula in UserForms (2003)

    I assume you will be using either Combo Boxes or List Boxes to let the user select his answers. You will need to put VBA code in one of the event routines (probably the Change Event or Click Event) for the first Combo Box or List Box to build the list of items in the other two Combo Boxes or List Boxes.
    Legare Coleman

  4. #4
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Formula in UserForms (2003)

    It is possible to just use the workbook IF function: use the RowSource/ControlSource properties of a combo box to get/save the values from/in your workbook, then use a workbook IF function to setup the RowSource range. In the attached example, I defined a named range, Types, on the Form worksheet for B2:B3 and a named range Type on the Results worksheet. I then used these ranges as the RowSource and ControlSource, respectively, for the first combo. I did the same thing with named ranges, Items and Item for the second combo. Then, I used workbook IF functions to setup each of the Items. Note, my preference would have been to do this in a combo box event. See next post for a "better" implementation.
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  5. #5
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Formula in UserForms (2003)

    I like this example better. HTH --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

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