Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Making changes to most worksheets?

I have a workbook where I want to make some cell protection changes on most
of the sheets. There are about 100 sheets so I'd rather not do them
individually.

I want to unprotect certain cells so that when the sheet is 'protected'
these cells can still be used for entry and pasting.

Here's what I have so far, but it's not working: (copied from another
workbook and modified)

'TempProtect ()

Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets

Range("I2,J2,L2,N2,O2:P2,A35:T36,A35").Select
IF Worksheet.name = "Index" Then Next (I want it to skip this
worksheet)
IF Worksheet.name = "Trans" Then Next (I want it to skip this
worksheet also)
IF Worksheet.name = "Customers" Then Next (I want it to skip this
worksheet too)
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True

Next

End Sub

Any help you can give me is appreciated.
Jonco


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Making changes to most worksheets?


try this:


Sub TempProtect()

Dim ws As Worksheet
Dim rng As Range

For Each ws In ThisWorkbook.Worksheets
Select Case ws.Name
Case "Index", "Trans", "Customers"
'don't do anything
Case Else
Set rng = ws.Range("I2,J2,L2,N2,O2:P2,A35:T36,A35")
rng.Locked = False
rng.FormulaHidden = False
ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Select

Next
MsgBox "done"
End Sub

regards


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=557605

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Making changes to most worksheets?

Thanks guys, I'll give these a try. I appreciate it.

Jonco


"jonco" wrote in message
. com...
I have a workbook where I want to make some cell protection changes on most
of the sheets. There are about 100 sheets so I'd rather not do them
individually.

I want to unprotect certain cells so that when the sheet is 'protected'
these cells can still be used for entry and pasting.

Here's what I have so far, but it's not working: (copied from another
workbook and modified)

'TempProtect ()

Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets

Range("I2,J2,L2,N2,O2:P2,A35:T36,A35").Select
IF Worksheet.name = "Index" Then Next (I want it to skip this
worksheet)
IF Worksheet.name = "Trans" Then Next (I want it to skip this
worksheet also)
IF Worksheet.name = "Customers" Then Next (I want it to skip this
worksheet too)
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True

Next

End Sub

Any help you can give me is appreciated.
Jonco



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Making changes to most worksheets?


Is it all worksheets or just some?

do A ?ws.name in the immediate pane to find out.

I would guess it might be something to do with the worksheet alread
being protected.

Sorry I can't investigate further ... got work to d

--
tony
-----------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...fo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=55760

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
Making 1 Pivot chart from 3 different worksheets. spudsnruf Excel Discussion (Misc queries) 4 September 3rd 09 03:00 AM
Making changes automatically on multiple worksheets aaorbin Excel Discussion (Misc queries) 2 February 24th 09 05:11 PM
Making worksheets Fabrizio Excel Programming 3 June 28th 06 01:29 PM
making new worksheets april27 Excel Programming 1 June 19th 06 04:00 PM
Programatically making worksheets dorre Excel Programming 1 February 5th 06 03:02 PM


All times are GMT +1. The time now is 07:12 PM.

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"