Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect Workbook Vs Protect Sheet Poor_pakistani New Users to Excel 4 May 25th 06 02:06 PM
Can I protect columns w/in a "List" using Protect Sheet? Diane Excel Discussion (Misc queries) 0 May 10th 06 03:30 PM
Lock and protect cells without protect the sheet Christian[_7_] Excel Programming 6 December 28th 04 04:50 PM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM
how to protect a sheet youngman Excel Programming 4 August 20th 03 01:09 AM


All times are GMT +1. The time now is 09:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"