ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protecting Selected Sheets (https://www.excelbanter.com/excel-programming/357467-protecting-selected-sheets.html)

Nick S[_15_]

Protecting Selected Sheets
 

I have three sheets Sheet1, 2 & 3. I want to create a script that wil
password protect sheets 2 & 3 only.

Any help will be greatly appreciated.

Nick

--
Nick
-----------------------------------------------------------------------
Nick S's Profile: http://www.excelforum.com/member.php...fo&userid=1651
View this thread: http://www.excelforum.com/showthread.php?threadid=52764


Chip Pearson

Protecting Selected Sheets
 

Nick,


Worksheets(2).Protect Password:="whatever"
Worksheets(3).Protect Password:="whatever"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Nick S"
wrote in message
...

I have three sheets Sheet1, 2 & 3. I want to create a script
that will
password protect sheets 2 & 3 only.

Any help will be greatly appreciated.

Nick.


--
Nick S
------------------------------------------------------------------------
Nick S's Profile:
http://www.excelforum.com/member.php...o&userid=16512
View this thread:
http://www.excelforum.com/showthread...hreadid=527642




Don Guillett

Protecting Selected Sheets
 
use a loop something like
for each ws in worksheets
if ws.name <"sheet1" then ws.protect.password="joe"
next


--
Don Guillett
SalesAid Software

"Nick S" wrote in
message ...

I have three sheets Sheet1, 2 & 3. I want to create a script that will
password protect sheets 2 & 3 only.

Any help will be greatly appreciated.

Nick.


--
Nick S
------------------------------------------------------------------------
Nick S's Profile:
http://www.excelforum.com/member.php...o&userid=16512
View this thread: http://www.excelforum.com/showthread...hreadid=527642





All times are GMT +1. The time now is 04:20 PM.

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