PDA

View Full Version : Solved: Dynamic Drop down list based on filtered list



khalid79m
11-20-2009, 08:10 AM
I have attached a workbook, with comments.

I have a list of data which I filter , after the filter , i want my drop down in my excel form to only show the filtered data for unqiue id in the drop down. if that makes sense.

See workbook attached

mdmackillop
11-20-2009, 10:50 AM
No attachment

Simon Lloyd
11-21-2009, 10:55 PM
Without an attachment this, i assume is what you want:
Private Sub UserForm_initialize()
Dim Rng As Range, MyCell As Range
Set Rng = Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
For Each MyCell In Rng.SpecialCells(xlCellTypeVisible)
Me.ComboBox1.AddItem (MyCell)
Next
End SubThis code will add all the visible items in coulmn A.