ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   combobox question (https://www.excelbanter.com/excel-programming/351705-combobox-question.html)

Gary Keramidas

combobox question
 
is it possible to set the list fill range using a range name? or even just a
range?

this doesn't seem to work either,
Me.ComboBox1.ListFillRange = Worksheets("db").Range("b3:ad15")

i wanted to use something like this:
Me.ComboBox1.ListFillRange = rngLU
--


Gary




Dave Peterson

combobox question
 
Try passing a string.

Me.ComboBox1.ListFillRange _
= Worksheets("db").Range("b3:ad15").address(external :=true)

Or maybe to save some typing:

Dim myRng As Range

With Worksheets("DB")
Set myRng = .Range("b3:ad15")
End With

With Me.ComboBox1
.ColumnCount = myRng.Columns.Count
.ListFillRange = myRng.Address(external:=True)
End With



Gary Keramidas wrote:

is it possible to set the list fill range using a range name? or even just a
range?

this doesn't seem to work either,
Me.ComboBox1.ListFillRange = Worksheets("db").Range("b3:ad15")

i wanted to use something like this:
Me.ComboBox1.ListFillRange = rngLU
--

Gary


--

Dave Peterson

Gary Keramidas

combobox question
 
used the first example for now, may try the 2nd if the range is going to expand.
thanks dave

--


Gary


"Dave Peterson" wrote in message
...
Try passing a string.

Me.ComboBox1.ListFillRange _
= Worksheets("db").Range("b3:ad15").address(external :=true)

Or maybe to save some typing:

Dim myRng As Range

With Worksheets("DB")
Set myRng = .Range("b3:ad15")
End With

With Me.ComboBox1
.ColumnCount = myRng.Columns.Count
.ListFillRange = myRng.Address(external:=True)
End With



Gary Keramidas wrote:

is it possible to set the list fill range using a range name? or even just a
range?

this doesn't seem to work either,
Me.ComboBox1.ListFillRange = Worksheets("db").Range("b3:ad15")

i wanted to use something like this:
Me.ComboBox1.ListFillRange = rngLU
--

Gary


--

Dave Peterson





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

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