View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Copy a master workbook (Excel 2003)?

It sounds like your main concern is that someone that is authorized to change
things might leave one or more sheets unprotected when they close the
workbook. This should take care of that:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim eachSheet As Worksheet
For Each eachSheet In ThisWorkbook.Worksheets
eachSheet.Protect
Next
Set eachSheet = Nothing
End Sub

If the sheets are protected with a password, change the one line to
eachSheet.Protect Password:="yourSecret-word"
where yourSecret-word is the real password for the sheets.

To put it into the proper location in the workbook, open it and then
right-click on the little Excel icon at the upper left of the Excel window.
From the list that pops up, choose [View Code]. Copy the code and paste it
into the module presented to you - edit the code if you need to in order to
deal with the password if you use one.

Save the workbook. You can test it by simply unprotecting one or two
sheets, closing the workbook and then reopening it - all sheets should be
protected.

"Kevin89" wrote:

I have a question that probably seems pretty basic to most, but here goes...I
have a workbook containing multiple sheets that gets updated many times
throughout the day by just three people. I don't want anyone other than
those three people to be able to make any changes or accidentally delete
something. I know I could unprotect and then protect the workbook each time
a change is needed, but I'm worried that that one time, someone will forget.
Is there a way to create an identical copy of the original that would get
it's info and updates directly from the original? The copy could then be
read-only and the master could remain unprotected and easier to use.

Thanks in advance for any suggestion.

Kevin