I have a combobox in excel which populates from a dynamic range so 'Listfillrange = worktype'
However the list has blank rows so an example combobox list will loook something like
Repair
BLANK
BLANK
BLANK
Strengthen
BLANK
BLANK
etc
I want to remove the BLANK itmes in the list and have tried the following code unsuccessfully
Can anyone help witht the syntax for this code which fails on If LenB(ComboBox2.ListIndex(i)) = 0?
Thanks
Os
However the list has blank rows so an example combobox list will loook something like
Repair
BLANK
BLANK
BLANK
Strengthen
BLANK
BLANK
etc
I want to remove the BLANK itmes in the list and have tried the following code unsuccessfully
Code:
Private Sub ComboBox2_Click()
For i = 0 To ComboBox2.ListCount
If LenB(ComboBox2.ListIndex(i)) = 0 Then
ComboBox2.RemoveItem (i)
End If
Next i
End Sub
Can anyone help witht the syntax for this code which fails on If LenB(ComboBox2.ListIndex(i)) = 0?
Thanks
Os