This program works seamlessly when I have the cell referenced to today's date and it is Friday, but when I want to type in a date that isn't =Today() for some reason it does not recognize that the typed in date is a Friday.
Can someone help me figure out why that is? From my understanding, vbFriday is associated with an integer value (6) so when I say
Dim A6 As Integer
If Weekday(A6)=6 Then
Else
in theory, it should recognize this and save my file in the Completed Time Sheets folder I have pathed below if the typed in date is a Friday. But it keeps putting it in the Incompleted Time Sheets folder.
Thank you in advance!
Can someone help me figure out why that is? From my understanding, vbFriday is associated with an integer value (6) so when I say
Dim A6 As Integer
If Weekday(A6)=6 Then
Else
in theory, it should recognize this and save my file in the Completed Time Sheets folder I have pathed below if the typed in date is a Friday. But it keeps putting it in the Incompleted Time Sheets folder.
Thank you in advance!
Code:
Sub Workbook_BeforeClose()
Application.EnableEvents = False
Application.DisplayAlerts = False
A6 = Date
If Weekday(A6) = vbFriday Then
ThisWorkbook.SaveAs ("C:\Time Sheets\Completed Time Sheets\" + "CMB(DONE)" + ".xlsm")
ThisWorkbook.Saved = True
Application.DisplayAlerts = True
Else
ThisWorkbook.SaveAs ("C:\Time Sheets\Incompleted Time Sheets\" + "CMB(NOT DONE)" + ".xlsm")
ThisWorkbook.Saved = True
Application.DisplayAlerts = True
End If
If Application.Workbooks.Count = 1 Then
Application.Quit
Else
ActiveWorkbook.Close
End If
End Sub