Hey guys here is my function:
Pretty much all I am trying to do is automatically save every Friday when the excel spread sheet is exited. I thought this code would work but it just save every time I exit regardless of what day it is. Any help is appreciated.
Thanks
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Weekday(Date) = 5 Then
ChDir "G:\CHPP\METALLURGY\Reports\2017\CHPP Summary\Weekly"
ActiveWorkbook.SaveAs Filename:= _
"G:\CHPP\METALLURGY\Reports\2017\CHPP Summary\Weekly\01 January17.xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End If
End Sub
Pretty much all I am trying to do is automatically save every Friday when the excel spread sheet is exited. I thought this code would work but it just save every time I exit regardless of what day it is. Any help is appreciated.
Thanks
Last edited: