PROTECT MULTIPLE SHEETS IN EXCEL WORKBOOK SIMULTANEOUSLY?

  • Thread starter Thread starter SEAKAPTAIN
  • Start date Start date
S

SEAKAPTAIN

LOOKING FOR WAY T0 PRTECT SEVERAL OR ALL SHEETS IN EXCEL WORKBOOK AT ONCE
WITHOUT HAVING TO DO EACH INDIVIDUALLY. ALSO, CONSECUTIVELY DATE SHEETS IN
WORKBOOK WITHOUT HAVING TO DO INDIVIDUALLY ???
 
You could use a macro like this:

Option Explicit
Sub testme()
Dim dCtr As Long
Dim wks As Worksheet

dCtr = DateSerial(2008, 10, 2)

For Each wks In ActiveWorkbook.Worksheets
wks.Name = Format(dCtr, "yyyy-mm-dd")
dCtr = dCtr + 1
wks.Protect Password:="TopSecret"
Next wks
End Sub


If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)
 
Back
Top