I am trying to use a command button to unhide rows within my range. I have 8 command buttons each for a different range/table. Currently this button is unhiding all rows in all ranges. Not sure what I have done wrong here.
VBA Code:
Private Sub CommandButton1_Click()
Dim i As Integer
i = 18
For i = 18 To 41
Do
If Rows(i).Hidden = True Then
Rows(i).Hidden = False
Exit Do
ElseIf Rows(i).Hidden = False Then
i = i + 1
Else
End If
Loop Until i = 41
If i = 41 Then
MsgBox "There are no more rows for hourly labor remaining"
Else
End If
Cancel = True
Next i
End Sub