I have a macro written that will unhide the rows I want to be displayed on another sheet, but I cannot get it so that they will remain hidden when the checkbox is not clicked.
Any help would be appreciated!
I have it written two ways - can you tell me where I'm going wrong?!
Sub RemotePatrols()
'
' RemotePatrols Macro
' Unlock the section for Remote Patrols on The Services Sheet
'
'
If CheckBox = True Then
Sheets("Services").Select
ActiveSheet.Unprotect Password:="Password"
Range("16:31").EntireRow.Hidden = False
ActiveSheet.Protect Password:="Password"
Sheets("Overall Information").Select
End If
If CheckBox = False Then
Sheets("Services").Select
ActiveSheet.Unprotect Password:="Password"
Range("16:31").EntireRow.Hidden = True
ActiveSheet.Protect Password:="Password"
Sheets("Overall Information").Select
End If
End Sub
ORRRRRR
Sub RemotePatrols_Click()
If CheckBox = True Then
Sheets("Services").Select
ActiveSheet.Unprotect Password:="Password"
[16:31].EntireRow.Hidden = False
ActiveSheet.Protect Password:="Password"
Sheets("Overall Information").Select
Else:
Sheets("Services").Select
ActiveSheet.Unprotect Password:="Password"
[16:31].EntireRow.Hidden = True
ActiveSheet.Protect Password:="Password"
Sheets("Overall Information").Select
End If
End Sub
Any help would be appreciated!
I have it written two ways - can you tell me where I'm going wrong?!
Sub RemotePatrols()
'
' RemotePatrols Macro
' Unlock the section for Remote Patrols on The Services Sheet
'
'
If CheckBox = True Then
Sheets("Services").Select
ActiveSheet.Unprotect Password:="Password"
Range("16:31").EntireRow.Hidden = False
ActiveSheet.Protect Password:="Password"
Sheets("Overall Information").Select
End If
If CheckBox = False Then
Sheets("Services").Select
ActiveSheet.Unprotect Password:="Password"
Range("16:31").EntireRow.Hidden = True
ActiveSheet.Protect Password:="Password"
Sheets("Overall Information").Select
End If
End Sub
ORRRRRR
Sub RemotePatrols_Click()
If CheckBox = True Then
Sheets("Services").Select
ActiveSheet.Unprotect Password:="Password"
[16:31].EntireRow.Hidden = False
ActiveSheet.Protect Password:="Password"
Sheets("Overall Information").Select
Else:
Sheets("Services").Select
ActiveSheet.Unprotect Password:="Password"
[16:31].EntireRow.Hidden = True
ActiveSheet.Protect Password:="Password"
Sheets("Overall Information").Select
End If
End Sub