Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to password protect several excel workbook pages using a macro

I can write a macro to protect lots of pages in a big workbook, but they are
protected without a password. How can I password protect them? I use Excel
2000.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default How to password protect several excel workbook pages using a macro

In Help, look up the syntax for the Protect method of the worksheet. (In the
immediate window, type protect, then press F1.) Help has everything you want
to know.

On Mon, 27 Sep 2004 21:27:02 -0700, "p88t"
wrote:

I can write a macro to protect lots of pages in a big workbook, but they are
protected without a password. How can I password protect them? I use Excel
2000.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default How to password protect several excel workbook pages using a macro

Assume by "pages" you mean "worksheets".

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Protect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Unprotect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

Gord Dibben Excel MVP

On Mon, 27 Sep 2004 21:27:02 -0700, "p88t"
wrote:

I can write a macro to protect lots of pages in a big workbook, but they are
protected without a password. How can I password protect them? I use Excel
2000.


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
How to remove password protect to open Excel 2007 workbook JoWrobs Excel Discussion (Misc queries) 3 February 4th 10 11:18 PM
How do I password protect an excel workbook? Debbie B Excel Discussion (Misc queries) 2 August 3rd 09 01:05 PM
How do I password protect a workbook in Excel? Elmer Excel Discussion (Misc queries) 4 March 13th 08 06:50 PM
Password Protect a Workbook ? Bubey New Users to Excel 4 December 19th 06 03:13 AM
password protect workbook Rob Excel Discussion (Misc queries) 1 August 16th 06 11:55 AM


All times are GMT +1. The time now is 07:56 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"