View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
des-sa[_2_] des-sa[_2_] is offline
external usenet poster
 
Posts: 74
Default help with protection of sheets

Sub locksheet()
'
' locksheet Macro
' Macro recorded 2008/07/17 by DISRI
'
' Keyboard Shortcut: Ctrl+l
'
Sheets("MASTER").Select
Sheets("MASTER").Copy Befo=Sheets(3)
Range("E1").Select
ActiveCell.FormulaR1C1 = "ENTER DATE"
Range("E2").Select
Sheets("MASTER").Select
Range("M6").Select
Selection.Copy
Sheets("ENTER DATE").Select
Range("M3").Select
ActiveSheet.Paste
Range("B3:K17").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("B21:M35").Select
Selection.ClearContents
Range("E1").Select
Sheets("MASTER").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlNoSelection
Sheets("ENTER DATE").Select
Range("E1").Select
End Sub


"Jim Thomlinson" wrote:

Post your existing code...
--
HTH...

Jim Thomlinson


"des-sa" wrote:

please help
i have a petty cash workbook file where there is a new sheet generated via a
macro for each day. the new sheet is generated by copying today's sheet and
clearing the contents for the new day. the date is entered into this new
sheet in cell E1, which then automatically becomes the sheet name of the new
one. is it possible to create vb code to automatically lock yesterday's
sheet for editing and hide it, so that at any point the financial person sees
only today's sheet - if so, could someone help with the code