Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro to re-protect sheet w/ original password after pasting valuesin new book
Hello,
I have built a large file with many hidden and password protected sheets and formulas. The end user of the file manipulates several cells on two visible sheets and then sends the entire workbook back to me. I only need a hardcoded record of the two sheets they manipulate. To save bandwidth, I am trying to build a button that will copy the two sheets to a new workbook and paste the values on those new sheets. This will allow the user to send me a much smaller file in return. I am getting stuck with the password protection, as I want both workbooks to remain protected upon completion of the macro. I have built the command button and simply can't figure out how to unprotect and then re-protect (with the original password after pasting the values) the two tabs in the new workbook. Any help is appreciated. Thanks. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro to re-protect sheet w/ original password after pasting values in new book
Hi
I think it's something like this you need: Sub test() Dim New_Wb As Workbook MyPass = "InitPass" Set New_Wb = Workbooks.Add 'Copy data New_Wb.Protect Password:=MyPass New_Wb.Close ThisWorkbook.Protect Password:=MyPass End Sub Regards, Per skrev i meddelelsen ... Hello, I have built a large file with many hidden and password protected sheets and formulas. The end user of the file manipulates several cells on two visible sheets and then sends the entire workbook back to me. I only need a hardcoded record of the two sheets they manipulate. To save bandwidth, I am trying to build a button that will copy the two sheets to a new workbook and paste the values on those new sheets. This will allow the user to send me a much smaller file in return. I am getting stuck with the password protection, as I want both workbooks to remain protected upon completion of the macro. I have built the command button and simply can't figure out how to unprotect and then re-protect (with the original password after pasting the values) the two tabs in the new workbook. Any help is appreciated. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to protect/unprotect a sheet using a macro with password | Excel Discussion (Misc queries) | |||
Protect sheet without password? | Excel Discussion (Misc queries) | |||
password protect a single sheet | Excel Discussion (Misc queries) | |||
Password Protect a Sheet | Excel Discussion (Misc queries) | |||
how do I protect formula's only, not entire sheet or book? | Setting up and Configuration of Excel |