ListFillRange not working

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have code that is setting the ListFillRange property of a combox box, but
it is not working.

I have

cboNames.ListFillRange = "A1:A10"

When ever this is run, no error comes up but then the combo box has nothing
in the list.

Any help would be greatly appreciated.

Thank you,
Jeff
 
try using a named range.
I name a list on another sheet, say sheet2, as "LostOne"
on the sheet code page for sheet1 add this

Option Explicit
Private Sub Worksheet_Activate()
SetCombo
End Sub
Private Sub SetCombo()
ComboBox1.ListFillRange = ThisWorkbook.Names.Item("ListOne")
End Sub

whenever sheet1 is activated, the combobox will have its listfill range set.
 
Patrick,

Thank u for the replay but that did not work either. Same thing.

But after several hours of pulling my hair out of my head & trying different
things,I found what the problem was.

If the worksheet that has the cmbobox is in "R1C1 Reference style" then it
does not work. As soon as I un checked it from Tools / Options, then it
worked.

I hope others at some time will read this so to save them the same pain.

Jeff
 
Back
Top