Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Macro for Unlocking Multiple Worksheets

Hello.

I have a file that has multiple worksheets, each are protected (locked) with
a similar password for each worksheet. Is there a way to unprotect all
worksheets all at once without having to click on each sheet and unprotect it
that way? Is there a Macro? Or something?

Thank you!
Storm
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Macro for Unlocking Multiple Worksheets

Option Explicit
sub testme()
dim myPWD as string
dim wks as worksheet
myPWD = "hi"
for each wks in activeworkbook.worksheets
wks.unprotect password:=mypwd
next wks
end sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



(Untested, uncompiled--watch for typos!)

Storm wrote:

Hello.

I have a file that has multiple worksheets, each are protected (locked) with
a similar password for each worksheet. Is there a way to unprotect all
worksheets all at once without having to click on each sheet and unprotect it
that way? Is there a Macro? Or something?

Thank you!
Storm


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Macro for Unlocking Multiple Worksheets

Hi Dave,

I just about gave up...thought no one would respond.

Yes, unfortunately, I am not that adept with creating macros thru VB script.
I will read up on the reference you indicated. Thank you.

For the mean time, do I simply copy paste your script below on the VB Script
editor and just replace the "hi" with my actual password?

Thanks again,
Storm

"Dave Peterson" wrote:

Option Explicit
sub testme()
dim myPWD as string
dim wks as worksheet
myPWD = "hi"
for each wks in activeworkbook.worksheets
wks.unprotect password:=mypwd
next wks
end sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



(Untested, uncompiled--watch for typos!)

Storm wrote:

Hello.

I have a file that has multiple worksheets, each are protected (locked) with
a similar password for each worksheet. Is there a way to unprotect all
worksheets all at once without having to click on each sheet and unprotect it
that way? Is there a Macro? Or something?

Thank you!
Storm


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Macro for Unlocking Multiple Worksheets

Yep. Except this is VBA, not VBScript.

Take a look at David McRitchie's site. You'll find details there.

Storm wrote:

Hi Dave,

I just about gave up...thought no one would respond.

Yes, unfortunately, I am not that adept with creating macros thru VB script.
I will read up on the reference you indicated. Thank you.

For the mean time, do I simply copy paste your script below on the VB Script
editor and just replace the "hi" with my actual password?

Thanks again,
Storm

"Dave Peterson" wrote:

Option Explicit
sub testme()
dim myPWD as string
dim wks as worksheet
myPWD = "hi"
for each wks in activeworkbook.worksheets
wks.unprotect password:=mypwd
next wks
end sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



(Untested, uncompiled--watch for typos!)

Storm wrote:

Hello.

I have a file that has multiple worksheets, each are protected (locked) with
a similar password for each worksheet. Is there a way to unprotect all
worksheets all at once without having to click on each sheet and unprotect it
that way? Is there a Macro? Or something?

Thank you!
Storm


--

Dave Peterson


--

Dave Peterson
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
locking and unlocking worksheets adam Excel Worksheet Functions 6 October 31st 07 05:31 PM
Run a macro on multiple worksheets? J@Y Excel Discussion (Misc queries) 3 February 3rd 07 10:24 AM
MACRO AND MULTIPLE WORKSHEETS Mel Excel Worksheet Functions 8 January 21st 07 02:53 PM
Use a macro on multiple Worksheets Bwoods Excel Discussion (Misc queries) 1 March 19th 06 11:20 PM
Macro to email multiple worksheets Daniel Excel Worksheet Functions 1 May 27th 05 04:19 AM


All times are GMT +1. The time now is 10:54 AM.

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

About Us

"It's about Microsoft Excel"