I have a source data file that is system generated every day so the last few "File_Name_68992372.xls". I have found some code on this forum to find the file and rename it to a predefined name, but I want the user to be able to specify where it gets saved so I need a save as dialog. I also want the file to be in .xlsm format.
Thanks
Sub FindFile()
' Find PR work sheet and set standard name
Dim result As Boolean
Dim wB As Workbook
For Each wB In Workbooks
If InStr(1, wB.Name, "File_Name") > 0 Then
wB.Activate
End If
Next wB
sTemp = ActiveWorkbook.FullName ' remember its name for reopen
sExtn = "File_Name"
ActiveWorkbook.Save ' save existing
fullfilename = sExtn ' set default new file name
ActiveWorkbook.SaveAs fullfilename, FileFormat:=52 ' save dated
ActiveWorkbook.Close ' close dated
Workbooks.Open sExtn ' reopen existing
End Sub
Bookmarks