I was able to do a fix, by adding a hidden tab with unused checkboxes containing the rest of the filters. That issue is resolved. After integrating this code with my real project, I have been getting another issue though.
I have changed
Private Sub cmdFilter_Click()
Dim cChk As Control, arrVals() As Variant, i As Integer
Unload Me
For Each cChk In Me.grpFilter.Controls
i = i + 1
If cChk.Value = False Then
ReDim Preserve arrVals(1 To i)
arrVals(i) = cChk.Tag
End If
Next cChk
On Error Resume Next
ActiveWorksheet.Range("A12").CurrentRegion.AutoFilter _
Field:=2, _
Criteria1:=Array(arrVals), _
Operator:=xlFilterValues
End Sub
To
Private Sub cmdFilter_Click()
Dim cChk As Control, arrVals() As Variant, i As Integer
Unload Me
For Each cChk In Me.grpFilter.Controls
i = i + 1
If cChk.Value = False Then
ReDim Preserve arrVals(1 To i)
arrVals(i) = cChk.Tag
End If
Next cChk
On Error Resume Next
Worksheets("MyWorksheet").Range("K:K").CurrentRegion.AutoFilter _
Field:=11, _ Criteria1:=Array(arrVals), _
Operator:=xlFilterValues
End Sub
I have been getting an error
Compile Error: Method or data memer not found
with GrpFilter highlighted. Any suggestions?
Bookmarks