ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to unlock worksheet (https://www.excelbanter.com/excel-programming/426537-macro-unlock-worksheet.html)

Kirsty

macro to unlock worksheet
 
I want my macro to unlock the worksheet before it runs, and then lock it
again after.

At the moment I have Sheets("Daily Report").Select
wsheet.Unprotect Password:="computer"

however this is getting an error.

Any suggestions?

Mike H

macro to unlock worksheet
 
Kirsty,

Do it like this

Sheets("Daily Report").Unprotect Password:="computer"
'do things
Sheets("Daily Report").Protect Password:="computer"

Mike

"Kirsty" wrote:

I want my macro to unlock the worksheet before it runs, and then lock it
again after.

At the moment I have Sheets("Daily Report").Select
wsheet.Unprotect Password:="computer"

however this is getting an error.

Any suggestions?


Kirsty

macro to unlock worksheet
 
thanks, works perfectly

"Mike H" wrote:

Kirsty,

Do it like this

Sheets("Daily Report").Unprotect Password:="computer"
'do things
Sheets("Daily Report").Protect Password:="computer"

Mike

"Kirsty" wrote:

I want my macro to unlock the worksheet before it runs, and then lock it
again after.

At the moment I have Sheets("Daily Report").Select
wsheet.Unprotect Password:="computer"

however this is getting an error.

Any suggestions?



All times are GMT +1. The time now is 08:46 AM.

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