Hello ldonis,
Paste this code into your UserForm. It work fine for me. The attached workbook also has the code added.
Sub HideShowRows(ByVal Match As String, ByVal HideCell As Boolean)
Dim Cell As Range
Dim Rng As Range
Dim Wks As Worksheet
Set Wks = ActiveSheet
Set Rng = Wks.Range("AB10")
Set RngEnd = Wks.Range("AB10:AB" & Rows.Count).Find("*", , xlFormulas, xlWhole, xlByRows, xlPrevious, False, False, False)
If RngEnd.Row < Rng.Row Then Exit Sub
Set Rng = Wks.Range(Rng, RngEnd)
For Each Cell In Rng
If Cell = Match Then
If Cell.EntireRow.Hidden = True And Not HideCell Then Cell.EntireRow.Hidden = False
If Cell.EntireRow.Hidden = False And HideCell = True Then Cell.EntireRow.Hidden = True
End If
Next Cell
End Sub
Private Sub CheckBox1_Click()
Call HideShowRows(CheckBox1.Caption, CheckBox1.Value)
End Sub
Private Sub CheckBox2_Click()
Call HideShowRows(CheckBox2.Caption, CheckBox2.Value)
End Sub
Private Sub UserForm_Click()
End Sub
Bookmarks