ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filling a ComoboBox with Values on a different Worksheet (https://www.excelbanter.com/excel-programming/274248-filling-comobobox-values-different-worksheet.html)

Dave Baranas

Filling a ComoboBox with Values on a different Worksheet
 
I am trying to populate a combobox's listfillrange with cells on a
different sheet

e.g.

ComboBox1.ListFillRange = Worksheets ("SheetXYZ").Range("AB100:AB200")

this gives me Run-Time error '1004"

Application-Defined or Object-Defined Error

I Tried to use some examples from this NewsGroup but they still give
back errors

--------------------------------------------------------------------------------------------------------

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


Is there a way to do this so I do not have to have cells on every
sheet to be the references for filling combobox's. I am trying to keep
my filesize from exploding as the amount of sheets is very large.

Thanks in Advance

Dave Barans

steve

Filling a ComoboBox with Values on a different Worksheet
 
Dave,

I think you want RowSource and not ListFillRange
and you need to enter it as a string

ComboBox1.RowSource = "SheetXYZ!AB100:AB200"

steve

"Dave Baranas" wrote in message
...
I am trying to populate a combobox's listfillrange with cells on a
different sheet

e.g.

ComboBox1.ListFillRange = Worksheets ("SheetXYZ").Range("AB100:AB200")

this gives me Run-Time error '1004"

Application-Defined or Object-Defined Error

I Tried to use some examples from this NewsGroup but they still give
back errors

--------------------------------------------------------------------------

------------------------------

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


Is there a way to do this so I do not have to have cells on every
sheet to be the references for filling combobox's. I am trying to keep
my filesize from exploding as the amount of sheets is very large.

Thanks in Advance

Dave Barans





All times are GMT +1. The time now is 02:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com