Hey guys,
My code currently activates on a specific day but I was wondering if I can also get it to activate at in between specific times as well? The times a need it to activate is in between 12pm and 1pm the code is bellow.
Any help is appreciated,
Kulmjord.
My code currently activates on a specific day but I was wondering if I can also get it to activate at in between specific times as well? The times a need it to activate is in between 12pm and 1pm the code is bellow.
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Weekday(Date) = 6 And Time("12:00:00") Then
fn = InputBox("Date", "Input the date", Date)
If fn = vbNullString Then
Cancel = True
Exit Sub
End If
ChDir "G:\CHPP\METALLURGY\Reports\2017\CHPP Summary\Weekly"
ActiveWorkbook.SaveAs Filename:= _
"G:\CHPP\METALLURGY\Reports\2017\CHPP Summary\Weekly\01 January17" & fn & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End If
End Sub
Any help is appreciated,
Kulmjord.