+ Reply to Thread
Results 1 to 8 of 8

Dependent Combobox Userform

  1. #1
    Forum Contributor
    Join Date
    04-09-2014
    Location
    Derby
    MS-Off Ver
    Office 2013 - For my sins
    Posts
    122

    Dependent Combobox Userform

    Hi Guys,

    I am currently running VBA when ComboBox1 is selected ComboBox2 shows specific information based on lists in the spreadsheet.

    Now I would like it if ComboBox2 showed "Business Improvement" then ComboBox3 will show information set in that list.

    Also, my submit button isn't working and I can't find out what's wrong using the debugger

    I've attached the spreadsheet as the lists will make more sense and hopefully you can help me.

    Thanks in advance.

    Frank
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Dependent Combobox Userform

    Hi there,
    the issue is in 'ComboBox2_Change'.
    You pick a text 'Business Improvement' and You test it against 'Business_Improvement' with underscore.
    Should be:
    Please Login or Register  to view this content.
    Is this Your issue?
    Regards
    Miroslav R.

    (If You like my solutions, feel free to add reputation.)

  3. #3
    Forum Contributor
    Join Date
    04-09-2014
    Location
    Derby
    MS-Off Ver
    Office 2013 - For my sins
    Posts
    122

    Re: Dependent Combobox Userform

    I was missing one s on 'Business' haha, thanks for pointing it out..

    The problem I have now is when I press the submit button I get 'Compile Error' 'Block If without End If'

    How can this be fixed, thanks.

  4. #4
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Dependent Combobox Userform

    Can You post the code with changes You made (& compile err)?

  5. #5
    Forum Contributor
    Join Date
    04-09-2014
    Location
    Derby
    MS-Off Ver
    Office 2013 - For my sins
    Posts
    122

    Re: Dependent Combobox Userform

    Of course, no problem..

    Please Login or Register  to view this content.
    The error I get is 'Compile Error: Block If without End If'

    If you can help i'd appreciate that!!

    Thanks

  6. #6
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Dependent Combobox Userform

    Hi there,
    look at this part:
    Please Login or Register  to view this content.
    You have there 3x 'If' but only 1x 'End If'.
    You should put 'End If' also after the first two 'Exit Sub' statement.

    Also You are using While-Wend to get the first blank cell (row) by looping through all rows.
    Isnīt it better to use any variationt of:
    Please Login or Register  to view this content.
    ?

  7. #7
    Forum Contributor
    Join Date
    04-09-2014
    Location
    Derby
    MS-Off Ver
    Office 2013 - For my sins
    Posts
    122

    Re: Dependent Combobox Userform

    Yes, that was it!!

    It's sorted now....

    Thanks soooo much dude

  8. #8
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Dependent Combobox Userform

    You are welcome!

+ 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] UserForm: ComboBox #2 dependent on ComboBox #1
    By TexasAggie12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-25-2014, 10:41 AM
  2. [SOLVED] Userform with two combobox dependent on one combobox
    By bigfoot007 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2012, 01:01 PM
  3. VBA Userform Dependent Combobox
    By TextMonkey in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-10-2011, 06:46 AM
  4. Dependent Combobox in Excel Userform
    By 2Deep in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-07-2010, 08:59 AM
  5. userform one combobox dependent on another
    By busydave in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2010, 06:05 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