Hi,
I'm using the following code to populate a ListBox:
On occasions, column D of Sheet2 will be empty. When this happens, I want my ListBox to be empty, i.e. no tick boxes.
At the moment a single tick box is added when column D is empty, so how can I prevent this from happening?
Cheers,
Matty
I'm using the following code to populate a ListBox:
Code:
LR = Sheet2.Range("D" & Rows.Count).End(xlUp).Row
With lbxTest
.Clear
For i = 1 To LR
.AddItem Sheet2.Range("D" & i).Value
Next i
End With
On occasions, column D of Sheet2 will be empty. When this happens, I want my ListBox to be empty, i.e. no tick boxes.
At the moment a single tick box is added when column D is empty, so how can I prevent this from happening?
Cheers,
Matty