Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Protect Sheet - VB code to specify password


Howdie,

Sheets("A").protect is how to protect a sheet, and similar
Sheets("B").Unprotect.
I run a Macro that first unprotects a sheet, then when Macro is finished
Re protects the sheet.

I want to now specify a password, lets say ABC.
Whats the VB to do that....?

Thanks

D

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Protect Sheet - VB code to specify password

Hi Darin,

Sheet("B").Unprotect "ABC"
assuming "ABC" is your password

Thanks
Xcelion


"Darin Kramer" wrote:


Howdie,

Sheets("A").protect is how to protect a sheet, and similar
Sheets("B").Unprotect.
I run a Macro that first unprotects a sheet, then when Macro is finished
Re protects the sheet.

I want to now specify a password, lets say ABC.
Whats the VB to do that....?

Thanks

D

*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Protect Sheet - VB code to specify password

Public sub yourMacro()

Shetts("A").Unprotect "ABC"
'Your code
Sheets("A").Protect "ABC"

End Sub

--
----------------------------
Mauro Gamberini

Sheets("A").protect is how to protect a sheet, and similar
Sheets("B").Unprotect.
I run a Macro that first unprotects a sheet, then when Macro is finished
Re protects the sheet.

I want to now specify a password, lets say ABC.
Whats the VB to do that....?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to protect/unprotect a sheet using a macro with password FredH Excel Discussion (Misc queries) 5 October 23rd 07 04:49 PM
Password protect only one VBA code module? RB Smissaert Excel Programming 1 December 31st 04 05:17 PM
password protect vba code greg Excel Discussion (Misc queries) 3 December 8th 04 04:03 PM
password protect vba code greg Excel Programming 3 December 8th 04 04:03 PM
password protect vba code delali Excel Programming 4 September 30th 04 06:32 PM


All times are GMT +1. The time now is 02:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"