![]() |
Re-protect sheet
Code below works fine, but need to re-instate password after changes
are made. Sub SwitchView_n_protect2() ActiveSheet.Unprotect Password:="jeremy" With ActiveSheet.Range("f:f,g:g").EntireColumn .Hidden = Not .Hidden End With ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True |
Re-protect sheet
try this:
Sub SwitchView_n_protect2() With ActiveSheet .Unprotect Password:="jeremy" With .Range("f:f,g:g").EntireColumn .Hidden = Not .Hidden End With .Protect DrawingObjects:=True, _ Contents:=True, _ Scenarios:=True, _ Password:="jeremy" End With End Sub -- jb "J.W. Aldridge" wrote: Code below works fine, but need to re-instate password after changes are made. Sub SwitchView_n_protect2() ActiveSheet.Unprotect Password:="jeremy" With ActiveSheet.Range("f:f,g:g").EntireColumn .Hidden = Not .Hidden End With ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True . |
All times are GMT +1. The time now is 02:25 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com