Unprotect, Run Action then Protect

J

JAD

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
 
J

John Bundy

Do everything like you did before, but you should change the unprotect line
to add password like this:
ActiveSheet.Unprotect Password:="test"
 
O

Orion Cochrane

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top