About to throw my computer across the room. I've got a sub routine named 'Private Sub FullRosterListBox_Click()' that applies to a combobox on a user form. When the user selects a name from the combobox, i want to populate other fields on the user form with the appropriate data.
One of the items I'm trying to populate is another combobox with all the groups the person is assign too. I have 2 sheets, RosterTab and GroupsTab. I want to autofilter the RosterTab based on the Last Name and First Name the user clicked on.
I run the autofilter and after it applies the 1st filter, it immediately restarts the Subroutine from the beginning. No idea why this is happening. Here's the code:
Set RosterRange = RosterTab.Range(RosterTab.Cells(1, 1), RosterTab.Cells(Rows.Count, 3).End(xlUp))
With RosterRange
.AutoFilter Field:=1, Criteria1:=PersonLName
.AutoFilter Field:=2, Criteria1:=PersonFName
ActiveWorkbook.Names.Add Name:="PersonList", RefersTo:=RosterRange
End With
As soon as the first .AutoFilter line runs, it starts back over at the beginning of the subroutine. I've tried without the 'With RosterRange' too to no avail.
One of the items I'm trying to populate is another combobox with all the groups the person is assign too. I have 2 sheets, RosterTab and GroupsTab. I want to autofilter the RosterTab based on the Last Name and First Name the user clicked on.
I run the autofilter and after it applies the 1st filter, it immediately restarts the Subroutine from the beginning. No idea why this is happening. Here's the code:
Set RosterRange = RosterTab.Range(RosterTab.Cells(1, 1), RosterTab.Cells(Rows.Count, 3).End(xlUp))
With RosterRange
.AutoFilter Field:=1, Criteria1:=PersonLName
.AutoFilter Field:=2, Criteria1:=PersonFName
ActiveWorkbook.Names.Add Name:="PersonList", RefersTo:=RosterRange
End With
As soon as the first .AutoFilter line runs, it starts back over at the beginning of the subroutine. I've tried without the 'With RosterRange' too to no avail.