Web Host Directory Forums

View original thread:  Excel Macros


Pages: 1 
KLove
Need Your Help. I need a Save As Excel Macro method that will save a file as new. I have a template and want to utilize the tempalte with a new name assigned everytime the user enters data. Any advice???

Thanks
James
Unfortunalely this does not work. Reasons being are when you assign a macro to a button, it has to be a direct action. When doing save as, you are given the option in the save as dialog box to save the file, but you have to either save it as a specific file name, or press cancel which makes the save as function in effective as a button. A Macro records every step once you hit the record button and will go through every procedure you do whilst recording which is why cancelling the save as dialog box makes the macro feature no good for this query.

Sorry
KLove
Thanks for your assistance James. However, I did find a macro that will work and here it is for not only your information but all others Excel buddies out there that might need this someday.

Private Sub CommandButton1_Click()

Dim Fs As String

Fs = Application.GetSaveAsFilename(fileFilter:="Microsoft Excel File (*.xls), *.xls")
If Fs = "False" Then Exit Sub
ThisWorkbook.SaveAs Fs

End Sub

I assign the macro to the button and it saves the file as requested.

Thanks again.

Return to Thread List