View Single Post
  #2   Report Post  
KL
 
Posts: n/a
Default

Hi Phil,

You can use loops like this one:

For each ws in ActiveWorkbook.Worksheets
ws.Unprotect
Next ws

Regards,
KL


"Phil Osman" wrote in message
...
I have a macro that simply looks like this:

Sheets("Template").Select
ActiveSheet.Unprotect
ActiveSheet.Next.Select
ActiveSheet.Unprotect
ActiveSheet.Next.Select
ActiveSheet.Unprotect
etc................

I have 72 sheets, and don't want to keep having to go in and paste in more
lines everytime I add a new sheet.
Is there someway to tell it to repeat the Select & Unprotect lines x
number
of times, which would give a MUCH shorter code! Or, maybe there is a way
to
tell it to keep repeating that until it gets to the last sheet in the
workbook ???

Phil

--
http://www.redbrick.dcu.ie/~pele