|
-
Jul 4th, 2000, 09:54 AM
#1
Thread Starter
Member
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
-
Jul 4th, 2000, 01:00 PM
#2
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|