Two Column VBA Drop Down only to show rows for non-blank cells.
I need a two column drop down, as I need to list only the left column after selection.
First Column named range: "Mylist"
I have two column / ten rows conditionally blank or filled cells. (Blanks are always arw the bottom.)
So I need two column combo box not list the blank rows (pivot column would be the left one refereed cells )
I am trying to base the code to the following "3 columns version" and modify however I can not succeed.
Dim i As Long
With ComboBox2
.ColumnCount = 3
.ColumnWidths = ";;0"
.TextColumn = 3
For i = 1 To 10
If Range("first2").Cells(i, 1).Value <> “” THen
.AddItem Range("Mylist").Cells(i, 1).Value
.List(.ListCount - 1, 1) = Range("Mylist").Cells(i, 1).Value
.List(.ListCount - 1, 2) = .List(.ListCount - 1, 0) & vbTab & .List(.ListCount - 1, 1)
End If
Next i
End With
I need a two column drop down, as I need to list only the left column after selection.
First Column named range: "Mylist"
I have two column / ten rows conditionally blank or filled cells. (Blanks are always arw the bottom.)
So I need two column combo box not list the blank rows (pivot column would be the left one refereed cells )
I am trying to base the code to the following "3 columns version" and modify however I can not succeed.
Dim i As Long
With ComboBox2
.ColumnCount = 3
.ColumnWidths = ";;0"
.TextColumn = 3
For i = 1 To 10
If Range("first2").Cells(i, 1).Value <> “” THen
.AddItem Range("Mylist").Cells(i, 1).Value
.List(.ListCount - 1, 1) = Range("Mylist").Cells(i, 1).Value
.List(.ListCount - 1, 2) = .List(.ListCount - 1, 0) & vbTab & .List(.ListCount - 1, 1)
End If
Next i
End With