+ Reply to Thread
Results 1 to 3 of 3

2 Problems !! comboboxes and arrays

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    26

    2 Problems !! comboboxes and arrays

    hi, all.

    I have many columns in a sheet. let's say sheets("1stData"), which contains students data.

    I have a 2 comboboxes cbStuClasses and cbStuNames

    in the sheet, column (a) contains the students names. and column (b) contain the student classes.

    as follow

    Names class
    stu1 1
    stu2 1
    stu3 1
    stu4 2
    stu5 2
    stu6 3
    stu7 3


    and so on..


    in combobox cbStuClasses i want the classes to be 1,2,3 .... and so on ( cbStuClasses.List =array(' the classes))

    and whenever i choose the class number,
    i want the students names in that class to be shown in cbStuNames. ( cbStuNames.rowsource = sheets("1stData").Range(rng).value ' Students names in the class chosen in cbStuClass)


    That are the problems i am suffering from..

    any help well be appreciated, and THANKs in advance.
    Last edited by Abo Rawad; 07-22-2013 at 01:53 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: 2 Problems !! comboboxes and arrays

    Abo Rawad,

    I'm guessing these are on a userform. If that is the case, then these codes should work for you.
    This is the UserForm_Initialize event that will populate a unique list of the classes:
    Please Login or Register  to view this content.

    When a class is chosen, the cbStuClasses_Change event is triggered, which can be used to populate the list of students with that class:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    01-12-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: 2 Problems !! comboboxes and arrays

    Man, you are a magician..

    Thank you vary much....

+ 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] problems with arrays
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2013, 06:25 PM
  2. [SOLVED] New to arrays-where do I find a good beginners guide to multi dimensional arrays
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-04-2013, 07:44 PM
  3. Problems using FOR with Arrays
    By davegugg in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-23-2009, 12:42 PM
  4. ComboBoxes and .ListIndex Problems
    By ddoney in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-15-2005, 06:38 PM
  5. [SOLVED] Problems with Excel Horizontal arrays with regional options using.
    By Dr. Strangelove in forum Excel General
    Replies: 0
    Last Post: 01-06-2005, 12:06 PM

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