+ Reply to Thread
Results 1 to 4 of 4

How to loop through cells and populate combo boxes using VBA and Excel?

  1. #1
    Registered User
    Join Date
    09-09-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    How to loop through cells and populate combo boxes using VBA and Excel?

    I have a worksheet called "Sheet" and each column has a list of variables (column B is Name)

    I have a user-form that has ComboBox1.

    I want to loop through all column B such that If cell(i,2)<>"" then add that item to the ComboBox1 else exit sub.

    This will basically add any non-blank item to the combo box list and will exit the sub when it comes to a blank cell.

    I would like to do this under the Initialize() sub so that when the form loads, it will load the most recent list.

    Let me know what you all think.

    Thanks!

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: How to loop through cells and populate combo boxes using VBA and Excel?

    does this get you going in the right direction?

    Please Login or Register  to view this content.
    the Me.ComboBox1 is the name of my combobox, yours may be different....
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    09-09-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: How to loop through cells and populate combo boxes using VBA and Excel?

    Quote Originally Posted by judgeh59 View Post
    does this get you going in the right direction?

    Please Login or Register  to view this content.
    the Me.ComboBox1 is the name of my combobox, yours may be different....
    Perfect, u da man. I have added a positive rep! Thanks

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: How to loop through cells and populate combo boxes using VBA and Excel?

    glad I could help and thanks for the rep point

+ 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] Combo box to auto populate text boxes
    By Flatdown in forum Access Tables & Databases
    Replies: 7
    Last Post: 10-11-2013, 03:43 AM
  2. Populate Text Boxes based on Combo Box Selection
    By Sasha28 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-14-2012, 06:32 PM
  3. Where to populate Combo Boxes
    By andrew c. in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-14-2011, 06:55 PM
  4. Best way to populate worksheet from 2 combo boxes
    By jswasson in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-07-2006, 08:25 AM
  5. Combination of 2 combo boxes to populate 3rd
    By AJ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2005, 07: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