View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dan Hatola Dan Hatola is offline
external usenet poster
 
Posts: 42
Default With statement on many sheets

Here is some basic code that will loop through all of the sheets in the
workbook. If you want to exclude some sheets, you can use an if statement.

For Each sht In ThisWorkbook.Worksheets
With sht
.EnableSelection = xlUnlockedCells
.ScrollArea = "A1:J75"
.Protect
End With
Next sht

Hope this helps.

Dan

"Rob" wrote:

I would like to know how to use a single With statement to apply to about 15
sheets

The statement for one sheet is.....

With Sheet5
.EnableSelection = xlUnlockedCells
.ScrollArea = "A1:J75"
.protect
End With

Rob