I want to remove empty items from the ListBox I have created with array. However at some point, as each time the ListCount value is updated, the code fails. How can I overcome this problem?
Private Sub RemoveEmptyRows(lst As msforms.ListBox)
With lst
For i = 0 To .ListCount - 1
If .List(i) = False Then
.RemoveItem i
End If
Next
End With
End Sub