Try the attached and modify as required. It uses option buttons linked to a cell.
Option Explicit
Sub Hide_Rows_By_Color()
Dim icolor As Long, c As Range
Select Case Range("A1").Value
Case 1: icolor = 6 'red
Case 2: icolor = 45 'blue
Case 3: icolor = 10 'green
Case 4: 'show all
Range("A5").CurrentRegion.EntireRow.Hidden = False
End Select
Application.ScreenUpdating = False
On Error Resume Next
For Each c In Range("A5").CurrentRegion
If c.Interior.ColorIndex = icolor Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Application.ScreenUpdating = True
End Sub
Bookmarks