+ Reply to Thread
Results 1 to 11 of 11

listbox of combobox2 depends on value choosen from listbox of combobox1

  1. #1
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    listbox of combobox2 depends on value choosen from listbox of combobox1

    I have a userform contain two comboboxes , one for names and second for marks, the RowSource of combobox Names is column A , the RowSource of Combobox Marks is second row from column B to M.
    I want a code in commandbutton1: if I choose the name from combobox Names like George , I want List of combobox Marks show just the head column where marks exist ( Mark A, Mark C , and Mark G for George names and Mark B , Mark D ,Mark J forg Elie names ) , and if I choose name doesn't have any Marks like Helen or Philip I want combobox Marks show all Marks names in second Row ( from Mark A , Mark B … till Mark L)

    see attached file

    Thanks in advanced
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: listbox of combobox2 depends on value choosen from listbox of combobox1

    To UserForm module
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: listbox of combobox2 depends on value choosen from listbox of combobox1

    dear Jindon :
    macro works perfect if there is value in the row of Name which i select from List of combobox Name , but if i select a name doesn't have any value to the right ( column B to M ) the List of combobox Marks still empty but it shoud have all the header Marks ( Mark A, Mark B, Mark C, Mark D, Mark E, Mark F,Mark G , Mark H , Mark I , Mark J , Mark K , Mark L ).

    also if you please can you write more simple macro to understand it .

    Thanks

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: listbox of combobox2 depends on value choosen from listbox of combobox1

    Simple macro?
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: listbox of combobox2 depends on value choosen from listbox of combobox1

    dear jindon ; the code is working very good , but i make some change on cells location ,to be the combobox2 list just between column K and column V , (not al cells in second row) , and the combobox1 list is column B ( B3 till end of column B )
    see attached file
    can you help me ?

  6. #6
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: listbox of combobox2 depends on value choosen from listbox of combobox1

    any help please Mr Jindon ? i couldn't know to change the code what i want .

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: listbox of combobox2 depends on value choosen from listbox of combobox1

    Why did you ask me for a "Simple macro" then?
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: listbox of combobox2 depends on value choosen from listbox of combobox1

    dear Mr Jindon , thanks to pay attantion and reply .
    i tried the code above , it works if there are data in rows between columns K : V , but it doesn't work if there is no data in any cell of row between columns K:V .
    example : if i select Helen or Philip from list of cmbobox1 and because all cell in their row between columns K:V = "" then list of combobox2 should have the value of all cells of 2nd row between column K:V , i mean list of combobox2 should have all the Marks ( Mark A, Mark B, Mark C, Mark D, Mark E, Mark F,Mark G , Mark H , Mark I , Mark J , Mark K , Mark L ).
    by the way i'm bebinning in VBA , so i couldn't understand the code ,i'm working on myself to know more about VBA
    thanks in advance Mr Jindon.

  9. #9
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: listbox of combobox2 depends on value choosen from listbox of combobox1

    any help please to change the code above to let combobox2 give me the result i want ?.

    Thanks

  10. #10
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: listbox of combobox2 depends on value choosen from listbox of combobox1

    no one can help ?

  11. #11
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: listbox of combobox2 depends on value choosen from listbox of combobox1

    where are you Mr. jindon ? why you didn't reply ? is there something wrong ? .

+ 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 combobox2 does not have unique values and will not fill listbox
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2013, 12:22 PM
  2. Disabling dependent combobox2 until selection is made in combobox1
    By newqueen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-24-2013, 11:25 AM
  3. [SOLVED] items in combobox2 depending on combobox1
    By minifreak in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-15-2012, 10:52 AM
  4. Using Entry of ComboBox1 to decide the entries of ComboBox2 using Excel Columns
    By sungodking in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2012, 08:11 AM
  5. Combobox2 dependent on Combobox1
    By teacher_rob in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-19-2011, 10:10 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