Two Column VBA Drop Down only to show rows for non-blank cells.

keromero

New Member
Joined
Feb 20, 2025
Messages
4
Office Version
  1. 2016
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
 

Forum statistics

Threads
1,226,901
Messages
6,193,577
Members
453,808
Latest member
EBERHARDTJOEY

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top