Some help with this one will be appreciated.
The aim/idea is that I have a Userform with 2 checkboxes and a Combobox.
In the Combobox, there is a list of names which appear on 2 sheets, the 2 Checkboxes are the names of the sheets.
The user selects the name they want to find on the list and also selects which sheet they want to apply the filter to. (just one or both)
The code I have written below applies the filter perfectly when the "La Worklist"
sheet is selected but doesn't do anything when the "SkillsMatrix"
sheet is selected. Not sure where I'm going wrong.
Private Sub Btn_AgentSearch_Click()
'Reset sheet first
Sheets("LA Worklist").Select
ActiveSheet.AutoFilterMode = False
Sheets("SkillsMatrix").Select
ActiveSheet.AutoFilterMode = False
'Run Filter
If Chk_LAWrkList.Value = True Then
Sheets("LA Worklist").Select
Range("D6").Select
Selection.AutoFilter
ActiveSheet.Range("$B$6:$MB$100").AutoFilter Field:=3, Criteria1:= Cbo_AgentFilter.Value
Else
End If
If Chk_SkillsMatrix = True Then
Sheets("SkillsMatrix").Select
Range("D9").Select
Selection.AutoFilter
ActiveSheet.Range("$B$9:$V$51").AutoFilter Field:=3, Criteria1:= Cbo_AgentFilter.Value
Else
End If
End Sub
Userform Screenshot
SkillsMatrix Screenshot
LA Worklist Sheet Screenshot