+ Reply to Thread
Results 1 to 4 of 4

Help with Dynamic UserForm in Excel

  1. #1
    Registered User
    Join Date
    06-30-2015
    Location
    Israel
    MS-Off Ver
    MS Office 2003, 2010, 2013
    Posts
    6

    Help with Dynamic UserForm in Excel

    Hi !

    I'm struggling this issue for a couple of days already…..

    Appreciate your help !

    The file with explanation is on attached.

    The case is that on UserForm I have a 1st ComboBox (for Group Field) that is the Only one that is built in advance.

    All other Subgroups ComboBoxes are Dynamic ComboBoxes and build programmatically according to sheet columns.
    As ComboBoxes are Dynamic, each one effect the next one.

    4 things I haven't found a way to solve anywhere:

    1. How can I adjust the dynamic UserForm code to work same as UserForm work on Sheet1. The logical idea is mark in Yellow on attached File.
    --------------------------------------------------------------
    2. How do I pass the values of All ComboBoxes to Sheet: AccIndex (i.e.: Sheets("AccIndex") on LastRow) ?
    I tried those two codes but it did not work:

    Please Login or Register  to view this content.
    ---------------------------------------------------------------
    3. How do I read , progromaticaly, the headers from the sheet to the Labels on UserForm (the labels will be updated with other names) ?
    ----------------------------------------------------------------
    4. And the last thing, I don't know if it is possible , but i'll ask anyway:
    Is the logical of Dynamic ComboBoxes can work from Last To first ComboBox , as well.
    Meaning, If I'll choose the 2223-3 from Last ComboBox, all the ComboBoxes above it, should already "Know" which values should be taken in them.

    For example:
    let's say I have 4 ComboBoxes.

    When I choose on: ComboBox4 >> 2223-3
    it should give on ComboBox3 >> 2222-2 and 2223-2
    and on ComboBox2 >> 2222-1
    and on ComboBox1 >> Group 2 ; The 1st ComboBox (for Group Field) is the Only one that is built in advance.
    can it be done ??

    Your help will be appreciated !

    posted on this forum as well:
    http://www.vbaexpress.com/forum/show...rForm-in-Excel


    Shlomi
    Attached Files Attached Files

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

    Re: Help with Dynamic UserForm in Excel

    Why are you adding the comboboxes programmatically? It would be much easier to have the comboboxes already on the userform and just populate them when the form loads. If you don't know how many subgroups you'll have, you could hide the comboboxes you don't need.

    3.) There are no labels on your userforms. Something like this would assign a header to a label control.
    Me.Label1.Caption = Sheets("Sheet1").Range("A1").Text

    4.) The last subgroup combobox is not populated until it's parent conbobox has a selection. There would be nothing to select that would affect previous comboboxes.
    Last edited by AlphaFrog; 12-05-2016 at 09:26 PM.
    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
    06-30-2015
    Location
    Israel
    MS-Off Ver
    MS Office 2003, 2010, 2013
    Posts
    6

    Re: Help with Dynamic UserForm in Excel

    Thanks AlphaFrog for your answer.

    This UserForm is part of a bigger project. in the bigger project , this dynamic userform should be pup up after double click event on ListBox.
    I'm doing it programmatically as this user form should be running on several different files, which I don't know , in advance, how many columns (= ComboBoxs) they will have.
    very strange that I could not find any post, whatsoever, on "How to copy Controls value, on a dynamic UserFrom, into worksheet ?" on google.....

    Re. answer no. 3.
    as I need it dynamically , i can not refer to a specific cell. need some kind of loop, to loop through all the headers and fetch the cells values into the Label one by one.

    4) You are absolutely right, but, the logical that i've being thinks of is:
    In case you choose the last combobox , the code should "see" that no combo box has being filled yet, and then the Last combobox will load into it all the items from the last column. after I choose an item it can filled the previuse (above) combo boxes.
    hope it is logical what i want to do. or it is just logical to me (?)

    Shlomi

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with Dynamic UserForm in Excel

    Hello Shlomi.unique,

    If I am not mistaken, you posted this same question Here.

    According to forum rules, we ask you let us know if you have posted a question elsewhere. Next time, please add a link to where you have posted a question.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. Creating dynamic userform rely on dynamic checkbox selection
    By END93 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2016, 06:39 PM
  2. [SOLVED] Excel VBA Create Dynamic Userform
    By raw_geek in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-06-2015, 10:21 AM
  3. Dynamic userform
    By asgersax in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-17-2014, 02:48 PM
  4. Replies: 4
    Last Post: 11-28-2012, 06:09 PM
  5. Dynamic userform help
    By gazza365 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2011, 07:16 PM
  6. Dynamic userform
    By gazza365 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2011, 03:08 AM
  7. Problems with a Userform (dynamic userform)
    By pierre08 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-19-2010, 09:16 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