D
Dave Baranas
Hi , I am having a terrible time getting a combobox to fill up now
that I have moved everything from a WorkSheet to a UserForm
When they were on a worksheet everything was fine as I could just use
ComBoBox.ListFillRange = ("A1:A10)
As long as my list was on the same sheet. I never got this to work
tryimg to load a list from another sheet ( and I tried the examples
from here but no luck, but I could live with that) So I changed my bad
design of lots of sheets to just a few and a master data sheet so I
could read and write from it...and life was good
So I try to go a step further and put all the controls on a nice user
form from a worksheet and spend hours because you can only drag and
drop them one at a time from a worksheet to a form and rename them
all. But thats OK too....cause I am going to be almost done I think
Now I can only fill a combobox by changing its properties in the form.
I tried these examples from an earlier post here and none of them
work. I have to show 2 columns in some and now this does not work
anymore because now the comboboxes are on a form instead of a
worksheet where I could get them to work either by changing object
properties or using VBA
Is there something so insanely stupid I am not seeing from lack of
sleep or can you really fill a combobox on a form using VBA code
instead of clicking on every one of these $%&^*(# things to get them
to fill up.
ThanksInAdvanceDaveBaranas
Using Excel 2002
-------------------------------------------------------------------------------------------------------------------
ComboBox1.List = Worksheets("Sheet1").Range("A1:A10").Value
or
ComboBox1.RowSource = "Sheet1!A1:A10"
or
Dim cell As Range
For Each cell In Worksheets("Sheet1").Range("A1:A10")
ComboBox1.AddItem cell.Value
Next cell
For more info on comboboxes/listboxes see
www.rubbershoe.com/listbox.htm
that I have moved everything from a WorkSheet to a UserForm
When they were on a worksheet everything was fine as I could just use
ComBoBox.ListFillRange = ("A1:A10)
As long as my list was on the same sheet. I never got this to work
tryimg to load a list from another sheet ( and I tried the examples
from here but no luck, but I could live with that) So I changed my bad
design of lots of sheets to just a few and a master data sheet so I
could read and write from it...and life was good
So I try to go a step further and put all the controls on a nice user
form from a worksheet and spend hours because you can only drag and
drop them one at a time from a worksheet to a form and rename them
all. But thats OK too....cause I am going to be almost done I think
Now I can only fill a combobox by changing its properties in the form.
I tried these examples from an earlier post here and none of them
work. I have to show 2 columns in some and now this does not work
anymore because now the comboboxes are on a form instead of a
worksheet where I could get them to work either by changing object
properties or using VBA
Is there something so insanely stupid I am not seeing from lack of
sleep or can you really fill a combobox on a form using VBA code
instead of clicking on every one of these $%&^*(# things to get them
to fill up.
ThanksInAdvanceDaveBaranas
Using Excel 2002
-------------------------------------------------------------------------------------------------------------------
ComboBox1.List = Worksheets("Sheet1").Range("A1:A10").Value
or
ComboBox1.RowSource = "Sheet1!A1:A10"
or
Dim cell As Range
For Each cell In Worksheets("Sheet1").Range("A1:A10")
ComboBox1.AddItem cell.Value
Next cell
For more info on comboboxes/listboxes see
www.rubbershoe.com/listbox.htm