Private Sub CommandButton1_Click()
For i = 1 To 18
If i <> 8 And i <> 16 Then _
Sheet1.Rows(i + 3).EntireRow.Hidden = IIf(Me.Controls("Ch" & i), False, True)
Next
End Sub
'-----------------------------------------------------------------------------------------
Private Sub CommandButton2_Click()
Unload Me
End Sub
'-----------------------------------------------------------------------------------------
Private Sub UserForm_Initialize()
Dim i, j As Integer
For i = 1 To 18
If Sheet1.Rows(i + 3).EntireRow.Hidden = False Then
If i <> 8 And i <> 16 Then
Me.Controls("Ch" & i) = True
j = j + 1
End If
End If
Next
If j = 16 Then Me.Ch19 = True
End Sub