I need to lock certain cells but also have the ability to have the user hide or display the rows with the locked cells. Is that possible with VBA using a macro button?
How can you have the user use this without supplying them the password to the sheet?
Private Sub Switch_view()
ActiveSheet.Unprotect
Rows("11:33").Select
Selection.EntireRow.Hidden = True
Range("C2:E2").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
Private Sub Most_likely_view()
ActiveSheet.Unprotect
Rows("11:34").Select
Selection.EntireRow.Hidden = False
Range("C2:E2").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.