Toggle Button - show/hide all rows where cells contain "BLANK"

Copper Contributor

I've created a helper column to return the word "BLANK" IF two cells are empty.

Now I want to create a toggle button to show and hide the blank rows (and change the name of the button). This is working for the FIRST found row in the range... how to I make it continue through G50?

 

Private Sub HDBKToggleButton_Click()
Set b = Columns("G").Find(What:="BLANK", LookIn:=xlFormulas)
If HDBKToggleButton.Caption = "Hide Blank Rows" Then
HDBKToggleButton.Caption = "Show Blank Rows"
b.EntireRow.Hidden = True
Else
HDBKToggleButton.Caption = "Hide Blank Rows"
b.EntireRow.Hidden = False
End If
End Sub

0 Replies