+ Reply to Thread
Results 1 to 4 of 4

Dropdown List in ComboBox

Hybrid View

  1. #1
    Registered User
    Join Date
    04-29-2014
    Location
    Salt Lake City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    15

    Dropdown List in ComboBox

    My ComboBox is not loading the list of items from the range I specified ("Accountability_Dept_Lookup" named range in the "Lookup" sheet). It was working earlier, but I'm not sure what is happening now. Here is my code:

    Private Sub UserFormDept_Initialize()
        DimcDept As Range
        Dim ws As Worksheet
        Set ws = Worksheets("Lookup")
        For Each cDept In ws.Range("Accountability_Dept_Lookup")
            With Me.cboDepartment
               .AddItem cDept.Value
          End With
        Next cDept
    End Sub
    Can anyone tell me what I am doing wrong? I'm also curious how to call on this when the workbook opens.
    Last edited by Leith Ross; 05-01-2014 at 06:07 PM. Reason: Added Code tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Dropdown List in ComboBox

    Hello

    Welcome to the Forum!

    It appears to be a typographical error.

    You code has...
        DimcDept As Range
    Your code should be...
        Dim cDept As Range
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-29-2014
    Location
    Salt Lake City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Dropdown List in ComboBox

    Thank you!! I knew it had to be something very simple, but I just didn't see it!

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Dropdown List in ComboBox

    Hello aearce2000,

    You're 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] Combobox dropdown to list range from sheet
    By nickmax1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-30-2013, 12:35 PM
  2. Combobox Dropdown List only shows first Item
    By Guido Meng in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 09:49 PM
  3. dropdown list/ComboBox
    By tullemann in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-26-2011, 01:44 PM
  4. Two column dropdown list in combobox macro excel
    By herukuncahyono in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2009, 05:32 AM
  5. ComboBox dropdown for a large list
    By irish1two3 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-15-2007, 06:11 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