ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unprotect, Run Action then Protect (https://www.excelbanter.com/excel-programming/416059-unprotect-run-action-then-protect.html)

JAD

Unprotect, Run Action then Protect
 
I have a worksheet that an end user can add a set number of rows each time
they left click on a specific graphic. To make sure of the integrity of the
worksheet, it is protected at all times other than when rows are added. The
basic sequence to adding rows is:

1) Unprotect the worksheet (password protected)
2) Add the additional rows to the existing template.
3) Protect the worksheet (password protected)

Using a combination of the macro recorder and VB, I am missing the line of
programming that I can write in the password to unprotect and at the end
write in the password to protect and return the spreadsheet to normal
protected status. How can I enter the password into VB to accomplish my goal?
Any help would be appreciated, Thank You, JAD

John Bundy

Unprotect, Run Action then Protect
 
Do everything like you did before, but you should change the unprotect line
to add password like this:
ActiveSheet.Unprotect Password:="test"
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"JAD" wrote:

I have a worksheet that an end user can add a set number of rows each time
they left click on a specific graphic. To make sure of the integrity of the
worksheet, it is protected at all times other than when rows are added. The
basic sequence to adding rows is:

1) Unprotect the worksheet (password protected)
2) Add the additional rows to the existing template.
3) Protect the worksheet (password protected)

Using a combination of the macro recorder and VB, I am missing the line of
programming that I can write in the password to unprotect and at the end
write in the password to protect and return the spreadsheet to normal
protected status. How can I enter the password into VB to accomplish my goal?
Any help would be appreciated, Thank You, JAD


Orion Cochrane

Unprotect, Run Action then Protect
 
When I want to protect a sheet, I actually record the process of protecting
and unprotecting the sheet because I do not accept the default settings for
protection.

"JAD" wrote:

I have a worksheet that an end user can add a set number of rows each time
they left click on a specific graphic. To make sure of the integrity of the
worksheet, it is protected at all times other than when rows are added. The
basic sequence to adding rows is:

1) Unprotect the worksheet (password protected)
2) Add the additional rows to the existing template.
3) Protect the worksheet (password protected)

Using a combination of the macro recorder and VB, I am missing the line of
programming that I can write in the password to unprotect and at the end
write in the password to protect and return the spreadsheet to normal
protected status. How can I enter the password into VB to accomplish my goal?
Any help would be appreciated, Thank You, JAD



All times are GMT +1. The time now is 07:24 PM.

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