JasonEnsor
Programmer
Hey,
So i have found myself looking for VBA answers once more, hopefully someone can help me with this. I have some code to populate a VBA userform listbox with data from a workbook. However what i want to do is to populate the listbox with values only if a certain criteria is met.
On my userform i have a combobox with Class Times on, when i select a class time and hit search i would like my list box to populate with all the swimmer names where the rows contain that that class time selected.
The code below populates everything. Just can't seem to figure out how to filter it on extra criteria. I am guessing it's going to be something stupid that i am missing.
Any help would be appreciated.
Many Thanks
J.
So i have found myself looking for VBA answers once more, hopefully someone can help me with this. I have some code to populate a VBA userform listbox with data from a workbook. However what i want to do is to populate the listbox with values only if a certain criteria is met.
On my userform i have a combobox with Class Times on, when i select a class time and hit search i would like my list box to populate with all the swimmer names where the rows contain that that class time selected.
The code below populates everything. Just can't seem to figure out how to filter it on extra criteria. I am guessing it's going to be something stupid that i am missing.
Any help would be appreciated.
Many Thanks
J.
Code:
Dim LastRow As Long
Dim SwimmerData As Range
'Clear Current List
RegisterList.Clear
With Worksheets("Swimmer Details")
LastRow = .Cells(Rows.Count, 1).End(xlUp).Row
For Each SwimmerData In .Range("A2:A" & LastRow)
RegisterList.AddItem SwimmerData.Value
Next SwimmerData
End With
Application.ScreenUpdating = False