PDA

View Full Version : Solved: Populating Combobox with Filtered Data



Rlb53
04-16-2012, 11:34 AM
I am attempting to populate a second combobox with information that has been filtered from a selected value within the first combobox.

So far... I've been unsuccessful.


Private Sub Owner_afterupdate()
Sheets("savedwork").Activate
With Range("a:a", Range("a4:a" & Rows.Count).End(xlUp))
.AutoFilter 1, Owner.Value
End With
Dim LastRow As Long
With Worksheets("savedwork")
LastRow = .Range("B" & Rows.Count).End(xlUp).Row

FacilityID.RowSource = .Range("B2:B" & LastRow)
End With

End Sub

Rlb53
04-16-2012, 11:35 AM
(The Combobox's are on a userform)

Rlb53
04-16-2012, 12:47 PM
I got it....

Dim cLoc As Range
Dim ws As Worksheet
Set ws = Worksheets("listssheet")
On Error GoTo line1:
For Each cLoc In ws.Range("facilityidlist")
With Me.FacilityID
.AddItem cLoc.Value
End With
Next cLoc
line1:

Thanks !!