View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default With statement on many sheets

How about just looping through the list of sheets:

dim mySheetNames as Variant
dim iCtr as long

mysheetnames = array("sheet1", "sheet 2", "another sheetname")

for ictr = lbound(mysheetnames) to ubound(mysheetnames)
with worksheets(mysheetnames(ictr))
.EnableSelection = xlUnlockedCells
.ScrollArea = "A1:J75"
.protect
end with
next ictr



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


--

Dave Peterson