I've taken this code from someone smarter than me on this forum, and have been using it at work. It saves a file with the current date and time. Something like this "My Awesome Report 11-30 0854". My boss just recently said she wants the reports to look like this: "11.30.12 My Awesome Report". I can't seem to tweak this to do what I want. Any ideas?
Sub Save_Workbook()
Dim p As Integer
Dim newFileName As String
'Workbook file name format: "My workbook YYYYMMDD-HHMM.xlsx" (space before date-time part)
'Example: "My workbook 20121001-152436.xls"
p = InStrRev(ActiveWorkbook.Name, " ") 'position of last space
newFileName = Left(ActiveWorkbook.Name, p) & Format(Now, " MMDD-HHMM") & ".xlsx"
ActiveWorkbook.SaveAs ActiveWorkbook.Path & "\" & newFileName
End Sub
Bookmarks