Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default help with protection of sheets

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default help with protection of sheets

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 192
Default help with protection of sheets

The following macro will protect the sheet after the sheet you have currently
selected and then hide it. Depending on where you put this in your current
macro, you may want to take out the ".Next" in the macro. Also, if you want
a password, you can add "Password:=abc123" after "Scenarios:=True. Hope this
helps!

Sub ProtectAndHide()

ActiveSheet.Next.Protect Scenarios:=True
ActiveSheet.Next.Visible = False

End Sub
--
-SA


"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

  #4   Report Post  
Posted to microsoft.public.excel.misc
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

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
Protection of many sheets Adam Excel Worksheet Functions 13 December 16th 09 05:08 PM
Applying Protection To Multiple Sheets Mhz New Users to Excel 4 July 6th 06 01:22 PM
Password protection for Excel sheets Alejandro Excel Discussion (Misc queries) 2 April 13th 05 03:33 PM
Protection and Hiding Sheets JudithJubilee Excel Discussion (Misc queries) 4 March 4th 05 02:16 PM
Changing password protection on sheets Tom Hewitt Excel Discussion (Misc queries) 5 February 25th 05 03:33 PM


All times are GMT +1. The time now is 02:36 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"