Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe...
Option Explicit Sub testme() Dim myNewFileName As String Dim myPath As String Dim wkbk As Workbook Set wkbk = ActiveWorkbook myPath = wkbk.Path & "\" 'or set it to the path you want myNewFileName = wkbk.Name 'strip off .xls If LCase(Right(myNewFileName, 4)) = ".xls" Then myNewFileName = Left(myNewFileName, Len(myNewFileName) - 4) End If 'strip off date If Right(myNewFileName, 9) Like " ##-##-##" Then myNewFileName = Left(myNewFileName, Len(myNewFileName) - 9) End If 'add back space and date myNewFileName = myNewFileName & " " & Format(Date, "mm-dd-yy") & ".xls" 'MsgBox myNewFileName 'just to verify Application.DisplayAlerts = False 'overwrite without prompt wkbk.SaveAs Filename:=myPath & myNewFileName, FileFormat:=xlWorkbookNormal Application.DisplayAlerts = True End Sub KelliInCali wrote: I can't find the right code in any posts for this type of save. I just want to save the current file to a specified location without specifying the filename in the macro. In the macro, the active file is a template that needs to be saved as a spreadsheet. Ideally, I want to replace an existing file ("FILM 08-30-06") using the current date in the format shown ("FILM 09-05-06"). tia -kelli -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
File Saving macro ?!?! | Excel Programming | |||
Macro Help for Saving a file | Excel Worksheet Functions | |||
Saving a file via a Macro? | Excel Programming | |||
Saving a file in a macro | Excel Programming | |||
Saving a new file with a macro | Excel Programming |