ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   password protect copies of workbooks (https://www.excelbanter.com/excel-discussion-misc-queries/159211-password-protect-copies-workbooks.html)

dave caizley

password protect copies of workbooks
 
Hi

I have a master workbook that runs various macros to create a copy of a
selected sheet from the master into a new workbook.

Whilst I can protect the master, am I able to include within the macro code
that creates the copy, an instruction to protect all cells marked as locked.

Thanks in anticipation

Bernie Deitrick

password protect copies of workbooks
 
Dave,

Workbooks("MasterBook.xls").Sheets("Copy Me").Copy _
Befo=Workbooks("Target Book.xls").Sheets(1)
With Workbooks("Target Book.xls").Sheets("Copy Me")
.Name = "New Name" 'Optional
.Protect Password:="Password" 'Only needed if the original sheet was not protected
End With

HTH,
Bernie
MS Excel MVP


"dave caizley" wrote in message
...
Hi

I have a master workbook that runs various macros to create a copy of a
selected sheet from the master into a new workbook.

Whilst I can protect the master, am I able to include within the macro code
that creates the copy, an instruction to protect all cells marked as locked.

Thanks in anticipation





All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com