+ Reply to Thread
Results 1 to 5 of 5

populating list boxes and combo boxes in a user form.

  1. #1
    Registered User
    Join Date
    01-07-2014
    Location
    New York, NY
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    2

    populating list boxes and combo boxes in a user form.

    First off, let me just say i'm at total n00b, but I got started down a rabbit hole, and am now fascinated with the possibilites of coding VBA for excel.

    I'm basically trying to create a data entry user form which requires text inputs and I'd like to add in a list box and/or a combo box, but I can't seem to figure out how to populate the boxes. I've reworked a template I found online to suit my needs, and have googled (and tried) many different ways of populating the boxes from using the command .Additem to trying to get it to populate from a named range. I would appreciate any and all help!

    I've attached my workbook to this post... If you could take a look and let me know what I can do to make it work, i'd really appreciate it!

    thanks,
    Jeanie
    Attached Files Attached Files
    Last edited by ahceinaej; 01-09-2014 at 06:59 PM.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: populating list boxes and combo boxes in a user form.

    Welcome to the board!

    For Fixed value list, such as the States, use Rowsource. Click on the combobox, then scroll down to Rowsource and enter Lists!A5:A55. Be sure that you don't try to modify the control in anyway, like using Clear. You'll get a strange error message that seemingly has nothing to do with the control.

    For dynamic list, you can use a named range, or you can use a defined range.

    Named Range Example
    Please Login or Register  to view this content.
    To use a defined range, use something like
    Defined Range Example
    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    01-07-2014
    Location
    New York, NY
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    2

    Re: populating list boxes and combo boxes in a user form.

    Hi Tinbendr. Thanks for getting back to me so quickly. However, you lost me with "then scroll down to Rowsource"
    Where do I scroll? I don't know where to find "Rowsoure" so that I can enter the range....

    Also just tried cutting and pasting the codes for named range and the define range examples and neither of them worked. i'm still just getting an empty boxes for both the list box and the combo box.

    if it makes any difference i'm using Excel 2011 for mac.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: populating list boxes and combo boxes in a user form.

    Quote Originally Posted by ahceinaej View Post
    ..., you lost me with "then scroll down to Rowsource"
    Where do I scroll?
    Click on the combobox,
    Make sure the properties window is visible. View -> Properties The items are in alphabetical order.

    Make sure you comment out the code in the Initialize sub that refers to the States.

    and neither of them worked.
    Press F8 and step through the code, hovering over aCell and see what value debug shows you.

    If it's empty, you may have to specify the sheet.
    Please Login or Register  to view this content.
    For the defined range, you'll have to set the LastRow property, too.

    Please Login or Register  to view this content.
    Last edited by Tinbendr; 01-10-2014 at 11:28 AM.

  5. #5
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: populating list boxes and combo boxes in a user form.

    Try this...

    Please Login or Register  to view this content.

+ 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. User Form with with Populating Combo Boxes
    By Maneesh Massey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2013, 04:46 AM
  2. combo box user form code for two combo boxes
    By robert.begley1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-01-2012, 02:25 PM
  3. User Form Basics - Populating Text Boxes
    By T.J. Lanza in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-24-2009, 03:48 AM
  4. Cascading Combo Boxes in User Form
    By CRIMEDOG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2009, 10:44 PM
  5. [SOLVED] Excel User form with 4 Combo Boxes
    By ca1358 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-16-2006, 03:10 PM

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