Hi,
I have problem,
Here is code for sorting items alphabetically but it's showing empty cells, how to modify this code to stop showing empty cells?
Private Sub ComboBox1_DropButtonClick()
ComboBox1.Clear
Dim i As Long, j As Long, v As Variant
Dim tmp As Variant
v = Range("E2:E1000").Value
For i = 1 To UBound(v, 1) - 1
For j = i + 1 To UBound(v, 1)
If v(i, 1) > v(j, 1) Then
tmp = v(i, 1)
v(i, 1) = v(j, 1)
v(j, 1) = tmp
End If
Next
Next
ComboBox1.List = v
I am new to VBA programming and don't know how to do this.
Thanks.
Bookmarks