Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protection of many sheets | Excel Worksheet Functions | |||
Applying Protection To Multiple Sheets | New Users to Excel | |||
Password protection for Excel sheets | Excel Discussion (Misc queries) | |||
Protection and Hiding Sheets | Excel Discussion (Misc queries) | |||
Changing password protection on sheets | Excel Discussion (Misc queries) |