View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default changing passwords

Would this work?

Sub Dt()
x = Format(Now, "yyyy") & "Totals"
MsgBox "Password is " & x
End Sub

"davegb" wrote:

I googled in this NG for help, but couldn't find quite what I need.

One of my users created a workbook with worksheets for her staff to
enter coded status data which is then tabulated by a macro I wrote for
her. All works great.

Each of the worksheets is password protected. Worksheets with "Monthly"
in the title (like "Dave - Monthly", etc.) have a password of
"2006monthly". Worksheets with "Totals" in the sheetname have a
password of "2006totals". Now she needs to change these to
"2007monthly" and "2007totals", and will need to do this again next
year. I could just change them manually, but there are enough of them
that I'd rather right code to do it so that next year, she can change
it herself. But I'm not even sure how to start on this one, other than
a "for each" loop through the worksheets. Can someone get me started in
the right direction?

Thanks as always.