Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have used a combination of locking certain cells and then protecting
worksheet in order to prevent accidentally overwriting cells with formulae in them. This works fine for what I want but occasionally I need to change a formula so have to unprotect the sheet. Again, no problem but what I am looking for is a reminder to reprotect the worksheet after I have amended the formulae I need to change. I guess there is a macro or something I could write but please bear with me since I am unfamiliar with writing macros. Also, is it possible for this to be aplied to all sheets in the workbook? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Colin,
You could try this:- Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim sht As Worksheet For Each sht In Sheets sht.Select If ActiveSheet.ProtectContents = False Then MsgBox (sht.Name & " isn't protected") End If Next sht End Sub Alt+F11 to open VB editor. Double click 'This workbook. On the right hand side from the dropdown select 'workbook'. In the other dropdown select 'before save and paste this code in. Was that any use? Mike "Colin G" wrote: I have used a combination of locking certain cells and then protecting worksheet in order to prevent accidentally overwriting cells with formulae in them. This works fine for what I want but occasionally I need to change a formula so have to unprotect the sheet. Again, no problem but what I am looking for is a reminder to reprotect the worksheet after I have amended the formulae I need to change. I guess there is a macro or something I could write but please bear with me since I am unfamiliar with writing macros. Also, is it possible for this to be aplied to all sheets in the workbook? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Unprotect ur sheet
Start Macro recorder Protect ur sheet Stop recorder now u got a code to protect ur sheet There are difrent way's to start that code eg. Everytime u save ur sheet When u select another sheet When u select another cell When u change a cell When u open ur sheet and some others too whitch one do u vant ? "Colin G" skrev: I have used a combination of locking certain cells and then protecting worksheet in order to prevent accidentally overwriting cells with formulae in them. This works fine for what I want but occasionally I need to change a formula so have to unprotect the sheet. Again, no problem but what I am looking for is a reminder to reprotect the worksheet after I have amended the formulae I need to change. I guess there is a macro or something I could write but please bear with me since I am unfamiliar with writing macros. Also, is it possible for this to be aplied to all sheets in the workbook? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Thank you both. Not sure I fully understand the detail Mike but will give it a try. Excellent, I am probably looking to do it everytime I save sheet or workbook. It is really as a reminder if I forget to re-protect the sheet having made amendments. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The macro will loop through every sheet and if it isn't protected you will
get a message pop up. Mike "Colin G" wrote: Thank you both. Not sure I fully understand the detail Mike but will give it a try. Excellent, I am probably looking to do it everytime I save sheet or workbook. It is really as a reminder if I forget to re-protect the sheet having made amendments. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
ok i look like Mike allready did the job :-)
"Colin G" skrev: Thank you both. Not sure I fully understand the detail Mike but will give it a try. Excellent, I am probably looking to do it everytime I save sheet or workbook. It is really as a reminder if I forget to re-protect the sheet having made amendments. |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks again, will give it a go
|
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() I have opened VB editor and have copied macro in but when I close spreadsheet it says there is a syntax error. It appears to be pointing to the second row (Dim sht ....) but not sure. Because I have no idea on how VB works I don't know where to start looking in order to correct whatever I have done wrong. Any further help would be appreciated |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The question might be out of date still i give it a shot :
Looks like your still in the developing phase... I suggest : unprotect all sheets and/or workbook in One click Work is done ? protect your sheets and/or workbook Check the Add-in James 2007 available @ www.allocator.nl your welcome |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reminder in Excel? | Excel Worksheet Functions | |||
Reminder in excel | Excel Discussion (Misc queries) | |||
worksheet protection reminder | New Users to Excel | |||
Date Reminder | New Users to Excel | |||
Pop-Up Reminder | Excel Discussion (Misc queries) |