#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Read-Only

Is there a way to set all worksheets
to read only?

Thanks - Kirk
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Read-Only

Sub kirkm()
For Each ws In ActiveWorkbook.Sheets
ws.Protect
Next 'ws
End Sub

To unprotect them, change the term "Protect" to "Unprotect". Or you can
manually unprotect each sheet using Excel's menu: Tools|Protection|Unprotect
Sheet...

--
Jay


"kirkm" wrote:

Is there a way to set all worksheets
to read only?

Thanks - Kirk

  #3   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Read-Only

Follow-up information:

The procedure in my previous post protects all cells that are "Locked".
Because the default for all worksheet cells is Locked, the procedure should
work fine whenever the Locked property has not been adjusted in any workbook
cells. However, if your worksheets include any 'unlocked' cells, those cells
will not receive read-only protection.

Check or change the Locked property of a cell by: Format|Cells|Protection
Tab|Locked checkbox...

--
Jay


"kirkm" wrote:

Is there a way to set all worksheets
to read only?

Thanks - Kirk

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Read-Only

On Mon, 5 Mar 2007 16:24:18 -0800, Jay
wrote:

Sub kirkm()
For Each ws In ActiveWorkbook.Sheets
ws.Protect
Next 'ws
End Sub

To unprotect them, change the term "Protect" to "Unprotect". Or you can
manually unprotect each sheet using Excel's menu: Tools|Protection|Unprotect
Sheet...


Thanks Jay, that just what I wanted. Haven't got any locked
cells so that shouldn't be a factor.

Cheers - Kirk.

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
I have a read only xl file, I need it to be read and write drama queen Excel Discussion (Misc queries) 3 July 1st 06 12:25 AM
Read-write/Read-only Jillian Excel Discussion (Misc queries) 4 February 16th 06 05:26 PM
XCEL FILE REC'D AS READ ONLY -- HOW TO NOT BE "READ ONLY" billybob Excel Discussion (Misc queries) 1 February 13th 06 03:14 AM
How can a file be converted from Read-Only to Read/Write Jim in Apopka Excel Discussion (Misc queries) 2 November 19th 05 04:59 PM


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