@Watersev
That solved the issue of not populating all the names, however when I put the code in my live tracker this problem still occurs.
1. The ComboBox populates all the names from all the sheets, but it does so in sheet order. So there are duplicate names in the combobox where each one only reports the data for the sheet that name occurs on.
So, I tried Jaslake's advice and made a patient list. It is on the sheet named "Patient List". Then I tried changing this portion of code in order to populate the ComboBox from that list.
Private Sub UserForm_Initialize()
Dim i As Integer, lrow As Long, rng As Range, cl, istr As String
Me.ComboBox1.Text = ""
For Each nm In Array("Patient List")
With Sheets(nm)
lrow = .Cells(Rows.Count, 1).End(xlUp).Row
If lrow > 1 Then
Set rng = .Range("a2", .Cells(lrow, 1))
For Each cl In rng
If InStr(istr, cl) = 0 Then
If istr = "" Then istr = cl Else istr = istr & "|" & cl
End If
Next
End If
End With
Next
Me.ComboBox1.List = Split(istr, "|")
End Sub
That resolved the issue of duplicating names in the ComboBox, but when I select a name which I know has multiple occurences on different sheets, it only displays one result. For example, if "Washington, George" were on "Pending Stamp" and "2YR Hold", it would only report the occurence on "Pending Stamp". The strange thing is that the original code works perfectly in the Search Test workbook, no matter how I re arrange the names between sheets and how many duplicates there are. All the sheet names, locations etc are the same in my live tracker as they are in the test, so I'm not sure why it would do that. I've uploaded another version of the Search Test workbook that includes a "Patient List" sheet. Do I need to change something in the other parts of the code to make the report work properly when the combobox is populated by this list?
Edit: Nevermind, I figured out what was wrong. Got it working off the Patient List now. Thank you very much for your guys help.
Bookmarks