Combo Box Filtering

ScottP4680

New Member
Joined
Feb 19, 2020
Messages
6
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
I have a list of all possible things in one column (Let's say column A), and then in another column (let's make it non-adjacent, Column F), I have a list that has data populated in some rows (of column F), but not others. I want
the combo box to reflect only the things in Column A which have data in Column F.

My list in column A might be 40 items long, but only 3 or 4 of them actually have data populated in F. Is there a non-VBA way to do this? I don't want to have to scroll up and down through all 40 items in column A to get things in rows 2, 18, and 33 for every instance I'll be using.

I'm not really VBA literate (I can read it, and understand what's going on generally, but I couldn't write a module or command to save my life), but if that's the only way to do this, let me know. If whomever could maybe drop some code my way, I'd appreciate it. I know how to paste it into the sheet macros and VBA modules.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
What are you using the ComboBox for if you say you do not want to use Vba.
And why are you saying lets say column A and lets say column F

Why not be specific?
But try this if you want. I know of no way to do this without using Vba.
VBA Code:
Private Sub CommandButton1_Click()
'Modified 2/21/2020 1:02:40 PM EST
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
ActiveSheet.ComboBox1.Clear
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To Lastrow
If Cells(i, "F").Value <> "" Then ActiveSheet.ComboBox1.AddItem Cells(i, 1).Value
Next
Application.ScreenUpdating = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,702
Members
449,048
Latest member
81jamesacct

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