Results 1 to 2 of 2

Thread: combobox question??

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Posts
    52
    I'm trying to write a VBA macro which consists of a UserForm with a dropdown menu. In one tab I have a list of items that I want to dynamically fill the combobox with. Does anyone know how to do this? For example, in a sheet 1 I have the following items in column A: apple, pears, oranges, and grapes. Basically, when the userform pops up I want the combobox to consists of the apples, pears, oranges and grapes. This list in column A is always growing and I want the combobox to be populated with items from column A. If anyone can help I would greatly appreciated. Thank you!


    Marci
    Marci Sarwan

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655

    Thumbs up

    Here is one way I sometimes use:

    Code:
    Private Sub UserForm_Activate()
    Dim i As Integer
    i = 1
    Do While IsEmpty(Worksheets("Sheet1").Range("A" & i).Value) = False
        ComboBox1.AddItem Worksheets("Sheet1").Range("A" & i).Value
        i = i + 1
    Loop
    End Sub
    Let me know if you need anything else.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width