Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Macro to Unprotect save worksheet and protect it again.

I need a macro to unprotect cells B6:O6 and protect them back.
I would appreciate your help .

Thank Ken Calhoun
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Macro to Unprotect save worksheet and protect it again.

Activesheet.Unprotect Password:="ABC"
Range("B6:O6").Locked = False
Activesheet.Protect Password:="ABC"





Activesheet.Unprotect Password:="ABC"
Range("B6:O6").Locked = True
Activesheet.Protect Password:="ABC"

--
Regards,
Tom Ogilvy


"holy41" wrote:

I need a macro to unprotect cells B6:O6 and protect them back.
I would appreciate your help .

Thank Ken Calhoun

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Unprotect save worksheet and protect it again.


This should do exactly as you asked!

Regards,
Simon

Sub Test()
ActiveSheet.Unprotect
Range("B6:O6").Select
Selection.Locked = False
Selection.FormulaHidden = False

'WHATEVER YOU WANT TO DO WITH THE CELLS HERE

Range("B6:O6").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True
Scenarios:=True
ActiveWorkbook.Save
End Su

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=56681

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/ unprotect worksheet cc Excel Discussion (Misc queries) 0 October 19th 07 09:27 PM
How do I unprotect a protected worksheet that has passwrod protect Iain A C T Excel Discussion (Misc queries) 9 September 28th 05 05:38 AM
protect/unprotect worksheet Alex Excel Programming 2 September 9th 05 06:40 PM
Protect/Unprotect Worksheet djn Excel Discussion (Misc queries) 1 May 12th 05 11:27 PM
Excel VBA - Problems using Protect/Unprotect a worksheet Gary Richie Excel Programming 2 February 6th 04 03:29 AM


All times are GMT +1. The time now is 04:05 AM.

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

About Us

"It's about Microsoft Excel"