I have a button that will hide rows within a range if the cell has a specific color, I need it to toggle though back and forth hiding/unhiding the rows with each click. I don't know enough about VBA to fix it.
Sub hide_green()
Dim Rng As Range
Dim MyCell As Range
Set Rng = Range("A11:A100")
For Each MyCell In Rng
If MyCell.Interior.ColorIndex = 43 Then
MyCell.EntireRow.Hidden = True
End If
Next MyCell
End Sub
Also is it possible to change the text of the button each click to coordinate with "Hide" "Unhide"?