Connect,
Frist off, I assume that you set the variable
l
to your list box, like this:
Also, if your "blank" items are strings of blanks, you'll have to use
Trim$
to remove the extra spaces:
-
Dim l As MSForms.ListBox
-
Set l = Me.ListBox1
-
-
Dim i As Long: i = 0
-
-
While i < l.ListCount
-
If "" = Trim$(l.List(i, 0)) Then: l.RemoveItem (i): Else i = 1 + i
-
Wend
So - did you see any errors, and where did you put the code?