+ Reply to Thread
Results 1 to 9 of 9

Question 3 of 3 - How can I get my UserForm to populate based on user input?

  1. #1
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Question 3 of 3 - How can I get my UserForm to populate based on user input?

    Ok, here is question 3 of 3.

    A HUGE thanks to bakerman2, AlphaFrog, Norie and Mehmetcik for all your help with questions 1 and 2!!

    What I mean by the title, is how can I get my userform to populate the 4 fields on multiple times based on a users input. Basically the user is asked how many line items they need to add. If their input is 3, then the 4 fields populate 3 times, with each grouping below the next. If their input is 8, then there would be 8 groupings. There is 3 comboboxes across the top of the userform and a textbox below them (see attached) in the manner below..

    UserForm1
    ComboBox1 ComboBox2 BomboBox3
    <----------------TextBox1----------------->
    CommandButton1

    If the user select/enters 3 in the input box(?) then the userform would populate as below

    UserForm1
    ComboBox1 ComboBox2 BomboBox3
    <----------------TextBox1----------------->

    ComboBox1 ComboBox2 BomboBox3
    <----------------TextBox1----------------->

    ComboBox1 ComboBox2 BomboBox3
    <----------------TextBox1----------------->

    CommandButton1

    Then, after the user fills in all the fields and clicks the command button, the 1st grouping will go to the next available row on Sheet1, the 2nd groupings info will be put in the row below that etc.
    I know this can be done, I've seen it in this forum before, but have been unable to find the thread that has the solution.

    546087d1509857043-how-can-i-get-my-combobox-list-to-fill-with-a-range-without-using-rowsource-p.xlsm
    Last edited by gmr4evr1; 11-08-2017 at 11:34 AM. Reason: Added forgotten attachment
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,165

    Re: Question 3 of 3 - How can I get my UserForm to populate based on user input?

    Hi Tom,

    See if this does what you want.

    Userform to mult rows.xlsm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Question 3 of 3 - How can I get my UserForm to populate based on user input?

    MarvinP,
    Thank you for the attached, unfortunately, not quite what I was looking for, and that is mostly my fault, I left out a key piece of info in my op. Let's tackle the 1st part then go from there. Here it is...

    When the user opens the workbook, before the userform shows, I'd like and inputbox(?) to show and ask the user how many line items they need to add/update. Based on the number they enter, I'd like the userform groupings (combobox1, combobox2, combobox3 and textbox1) to populate that many times on the userform. If the userform enters 3, then 3 groupings will show one below the other in the userform, if they enter 8, then 8 groupings would show on the userform.

    I hope this makes more sense.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,165

    Re: Question 3 of 3 - How can I get my UserForm to populate based on user input?

    OK then, try this one. I created a Public variable so it could be remembered between modules.

    Get Help - BG SS membership lists combined 2.xlsm

    http://www.cpearson.com/excel/Scope.aspx

  5. #5
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Question 3 of 3 - How can I get my UserForm to populate based on user input?

    Ok, the input box is correct, but, its adding the number entered as rows on sheet1 and duplicating the information for that many rows. I'm looking to add the groupings (probably not the correct term) to the userform like so

    Default userform
    UserForm1 Default.PNG

    Userform with 3 groupings when user enters 3 in input box.
    UserForm1 3 groupings.PNG

    The userform will populate itself based on the number that the user enters into the input box.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,165

    Re: Question 3 of 3 - How can I get my UserForm to populate based on user input?

    Is this what you really want? I think you could add extra controls on the UserForm and then Hide them but that sounds like a lot of work.
    What if you looped how many times the UserForm was displayed? I'll work on that idea instead.

    Get Help - BG SS membership lists combined 3.xlsm

    See if this isn't much better than what you suggested above.
    Last edited by MarvinP; 11-08-2017 at 04:35 PM.

  7. #7
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Question 3 of 3 - How can I get my UserForm to populate based on user input?

    MarvinP,
    Thanks for your continued help with this. The last attachment you provided isn't quite what I was looking for. Having said that, it's actually a nice alternative to what I'm wanting to do. If I'm unable to find the code I've been looking for, I'll use this one instead.

  8. #8
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Question 3 of 3 - How can I get my UserForm to populate based on user input?

    Here are 2 links that come very close to what I'm wanting to do. The 1st is the closest, but instead populating just textboxes from the value from textbox1 on userform 1, it would populate 3 comboboxes and 1 textbox grouping for the number entered into an input box.
    https://www.excelforum.com/excel-pro...-userform.html

    https://www.excelforum.com/excel-pro...-userform.html
    I'm still searching the forum for the post I saw that has the code I'm looking for. The problem is that it was close to or longer than a year ago when I saw it.

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,165

    Re: Question 3 of 3 - How can I get my UserForm to populate based on user input?

    I believe you will need to set the "Visible" property of the controls you don't want to see on your userform to false to get exactly what you show above. You will also need to create multiple sets of controls on the userform. This is why my loop above that shows the single form over and over is a better method! IMHO.

+ 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. [SOLVED] Using VBA to auto populate cells based on user input (without using formulas if possible)
    By guyinahatgames in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2014, 07:48 PM
  2. [SOLVED] How to Populate UserForm TextBox based on user defined Row selection by means of PopupBox
    By MooseAUH in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2013, 09:49 AM
  3. VBA Help needed to create a document based on user input thru UserForm
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-15-2013, 02:45 PM
  4. Code/Macro to populate table based on user input.
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-08-2011, 07:50 AM
  5. Auto populate based on user input
    By lotusblossom in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 01-20-2011, 02:58 AM
  6. Populate rows in the sheet based on user input in the cell
    By omdkhaleel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-04-2010, 10:48 AM
  7. Automatically populate a list based on defined categories -- user input varies
    By NearClueless in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2009, 06:05 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