PDA

View Full Version : Combobox ListFillRange



jammer6_9
11-22-2007, 02:39 AM
Comboboxes were created in the Worksheets. I am trying to use a ListFillRange IN Combobox2 when Combox1.value is true but gives me "Unspecified Error"


Private Sub cmbRest1_Change()
If cmbRest1.Value = "BK-KSA" Then 'combox1
With cmbBrand1 'combobox2
.Clear
.ListFillRange = Sheets("SOURCE").Range("D4:D23").Value 'or can I use .AddItem?


End With
End If


End Sub

Bob Phillips
11-22-2007, 02:50 AM
Private Sub cmbRest1_Change()
If cmbRest1.Value = "BK-KSA" Then 'combox1
With cmbBrand1 'combobox2
.Clear
.ListFillRange = Sheets("SOURCE").Range("D4:D23").Address
End With
End If

End Sub



__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

jammer6_9
11-22-2007, 03:05 AM
Same error still pointing to .clear but when i remove this, there was no error bu tno value comes out in the combobox.

Bob Phillips
11-22-2007, 03:07 AM
What sort of combo is it, forms or control toolbox?


__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

jammer6_9
11-22-2007, 03:18 AM
Control ToolBox...

Bob Phillips
11-22-2007, 03:35 AM
Of course, you can't use/don't need Clear in a bound combobox.

Just ditch that line.

jammer6_9
11-24-2007, 02:22 AM
As i ditch ".clear" line, no error pops in but no value showing in the combobox. :banghead:

Bob Phillips
11-24-2007, 03:11 AM
Is you sheet range full of data?