I have a workbook which will have sheets added everyday. The sheet template is protected so that only certain cells are editable. How can I copy the information on the sheet and paste on a new sheet but keep the new sheet protected? I would like the protection to happen automatically as other users will be copy and pasting in to new sheets but they won't know how to protect the sheet.
Thank you.
Is there a Module / Macro I can install that will automatically protect all worksheets upon save?
------------------------------------------
I found this answer in another post.. It works and answered my question.
The following macro cycless through all the worksheets in the active
workbook, protecting them and assigning the password of "Password"
Sub ProtectAll()
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ActiveWorkbook
For Each ws In wb.Worksheets
ws.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True, _
Password:="Password"
Next ws
Set wb = Nothing
Set ws = Nothing
End Sub
Place it in a VBA module by pressing Alt+F11, click INSERT on the menu and
select MODULE. You can either type the code above or cut and paste it. To
run the macro select TOOLS on the menu, click MACRO and then select MACROS.
The macro will be in the list of available macros. You can select it and
then click the RUN command button.
--
Kevin Backmann
Bookmarks