I was wondering if anyone had any ideas on how to help with this. I have a file that is saved multiple times during an 8 hour shift, what I want to do is
have it look in the destination folder for the file and save it under these conditions:
1. If the file was saved within 12 hours than overwrite it
2. If the file was not saved within 12 hours from now than append an index to the end of the file name.
My code:
Right now it just asks for the users last name and first initial and saves it appending the Now() date to the end of the filename. (Inputbox will be changed to grab the users env name so all they do is hit the hotkey for the macro and it saves for them.
have it look in the destination folder for the file and save it under these conditions:
1. If the file was saved within 12 hours than overwrite it
2. If the file was not saved within 12 hours from now than append an index to the end of the file name.
My code:
Code:
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 8/29/2007 by BerlGeof
'
' Keyboard Shortcut: Ctrl+s
'
Dim MyRange As String
MyName = InputBox("Enter Last name First initial") & " " & Format(Now(), "mm-dd-yy") & ".xls"
MyPath = "V:\Service WW\Global Service\Rochester\Status Reports"
ActiveWorkbook.SaveAs Filename:=MyPath & "\" & MyName, FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False
End Sub
Right now it just asks for the users last name and first initial and saves it appending the Now() date to the end of the filename. (Inputbox will be changed to grab the users env name so all they do is hit the hotkey for the macro and it saves for them.