ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   using macros to save files in different locations (https://www.excelbanter.com/excel-programming/368632-using-macros-save-files-different-locations.html)

Adam

using macros to save files in different locations
 
How do you get a macro to Save As a file that you have already prompted the
user for and assigned to a variable? The following code is what i have but i
can't get it to Save As the User input.


Dim vFile As String
vFile = InputBox("Please type in a date, I.E. January 2006")
ActiveWorkbook.SaveAs Filename:=vFile_
"C:\Documents and Settings\monthly\My Documents\vFile", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= False, CreateBackup:=False

NickHK

using macros to save files in different locations
 
Adam,
I guess you mean:
ActiveWorkbook.SaveAs Filename:= "C:\Documents and Settings\monthly\My
Documents\" & vFile & ".xls", FileFormat:=xlNormal

NickHK

"Adam" wrote in message
...
How do you get a macro to Save As a file that you have already prompted

the
user for and assigned to a variable? The following code is what i have

but i
can't get it to Save As the User input.


Dim vFile As String
vFile = InputBox("Please type in a date, I.E. January 2006")
ActiveWorkbook.SaveAs Filename:=vFile_
"C:\Documents and Settings\monthly\My Documents\vFile", FileFormat

_
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= False, CreateBackup:=False





All times are GMT +1. The time now is 11:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com