Password\Backup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two questions. In my workbook I have multiple sheets. I have one for
every day of the month. These need to be passworded. Is there away to apply a
password to just these sheets at one time instead of doing them one at a
time.I have a total of 45 sheets in workbook the other sheets I do not need
to password and some can not be passworded. I am not that familiar with VB.
My second question is there away to automatically back up this work book
automatically with an add on. I have tried Microsofts auto backup\save and
went and got the fix for it but it still does not work. It defaults back to
10 minutes and always ask before back up and saving.
thanks in advanace
Scott
 
Hi Scott,

Here is one way by looping through the sheets. I don't know how your sheet
names are set up but I'm assuming name of month and day - change to suit. If
you just want to protect the sheets without a password delete the last part
of that statement. I also show an unprotect macro in case you want to do
them all at once. You could install one or two buttons on a sheet to call
the macros:

Dim n As Long
Sub Prot()
n = 1
Do
On Error Resume Next
Sheets("May" & n).Activate
Sheets("May" & n).Protect password:="jones"
n = n + 1
Loop Until n = 31
End Sub

Sub UnProt()
n = 1
Do
On Error Resume Next
Sheets("May" & n).Activate
Sheets("May" & n).Unprotect password:="jones"
n = n + 1
Loop Until n = 31
End Sub

To save the Workbook copy the following macro in the VBE to the
"ThisWorkbook" sheet. Change the path to suit your workbook This will do the
automatic save:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
Me.Save
Me.SaveAs Filename:="C:\aaab\NGassists\MnthS_U.xls"
Application.DisplayAlerts = True
End Sub

CHORDially,
Art Farrell
 
Back
Top