View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.misc
Wonderboy Wonderboy is offline
external usenet poster
 
Posts: 1
Default Can I protect all excel tabs in a file with one password entry

Is there a way to prompt for the password?

"Gord Dibben" wrote:

Glad to help.

Thanks for the feedback.


Gord

On Mon, 2 Mar 2009 13:39:01 -0800, Sheetsie
wrote:

Understood. Thank you! This is exactly what I needed. Much appreciated Gord.

"Gord Dibben" wrote:

First we unlock all cells then lock column B and rows 2 & 3

Note: the protection of column B extends to all cells in that column, not
just rows 2 and 3

Is that that you want?

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
.Cells.Locked = False
.Range("B:B,2:3").Locked = True
.Protect Password:="123"
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Mon, 2 Mar 2009 10:56:01 -0800, Sheetsie
wrote:

Paul B - this is great stuff. How would I alter that statement to indicate a
specified range of columns and rows? e.g. I want to protect Column B, and
Rows 2 and 3 on all sheets.

"Paul B" wrote:

Indiana, you can use a macro like this,

Sub protect_sheets()

Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets

ws.Protect password:="123"

Next ws

End Sub
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Indiana born" <Indiana wrote in message
...
I have spreadsheets with multiple tabs - I presently have to password
protect
each tab separately. I'm looking for a way to protect all tabs with one
password entry. i am not share the files, but others do view them and I
don't want changes made.