Hi I am trying to use a command button to hide a small range of rows if they are blank and the same button to unhide I am struggling with the code below would appreciate advice on this. The code i have so far is as follows Many Thanks Rob
VBA Code:
Private Sub CommandButton1_Click()
If CommandButton1.Caption = "Hide" Then
Dim c As Range
For Each c In Range("B4:b72")
If c.Value = "" Then
c.EntireRow.Hidden = True
CommandButton1.Caption = "Show"
Else
If CommandButton1.Caption = "Show" Then
Rows("3:74").Select
Selection.EntireRow.Hidden = False
CommandButton1.Caption = "Hide"
Else
End If
End If
Next
End If
End Sub