View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_844_] Simon Lloyd[_844_] is offline
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