ASKER
When i run the recorded macro on the next file (Test 2.xls) it saves as Test 1.xls. I want it to save as Test 2.
Sub Save_1()
'
' Save_1 Macro
'
' Keyboard Shortcut: Ctrl+Shift+Q
Dim filename As String
Dim filepath As String
filepath = "C:\Users\Dan\Desktop\SSS 2\Export Cust\"
filename = ActiveSheet.Name & ".xls"
ActiveWorkbook.SaveAs filename:=filepath & filename, FileFormat:=xlExcel8
End Sub
ASKER
ASKER
ASKER
A spreadsheet is an interactive computer application program for organization, analysis and storage of data in tabular form. Spreadsheets developed as computerized simulations of paper accounting worksheets. The program operates on data represented as cells of an array, organized in rows and columns. Each cell of the array may contain either numeric or text data, or the results of formulas that automatically calculate and display a value based on the contents of other cells.
TRUSTED BY
the macro recorder just is recording, what you do with the mouse.
It is neither optimal nor it can built up a logic.
But a good start point to recognize objects you need to address.
If you save a file, the macro recorder just records the choosen name of the file and does the same with any file, where the macro is running.
So you have to relativate the macro and make it dependend from the Sheet Name.
The name of the saved file hast to be constructed from your actual environment.
ie NameToSave = ActiveSheet.Name or similar.
As I can not say, what your macro recorder has recorded, it may be an option to post the file (with some empty, but named sheets and to post the file here, so we can correct the macro in the right way.