ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I create a macro to Save As? (https://www.excelbanter.com/excel-discussion-misc-queries/1169-how-do-i-create-macro-save.html)

Shelly9633

How do I create a macro to Save As?
 
How do I write a macro to SaveAs? I want it to save the file as the same
filename it already has, but to put it in a different folder. Any help?

Peo Sjoblom

Record a macro while doing this under toolsmacorecord new macro

Of course that will save the file in the same folder everytime you run the
macro.

Regards,

Peo Sjoblom

"Shelly9633" wrote:

How do I write a macro to SaveAs? I want it to save the file as the same
filename it already has, but to put it in a different folder. Any help?


Shelly9633

Thank you for your speedy reply, however, I already tried that method. The
problem is, it makes the filename the same everytime. I have a different
filename each time, but the same folder.

For instance, I may have a filename of Shelly.xls, to be saved into
c:\myfolder

The next time I run the macro, I may have a filename of Ron.xls to be saved
into c:\myfolder.

When I ran the macro, it changed the filename of Ron.xls to Shelly.xls (the
filename I had when I actually created the macro)

(sigh...I know this isn't making sense. What makes me think that if I can't
even ask an intelligent question, that I should be trying to create macros,
lol?)

"Peo Sjoblom" wrote:

Record a macro while doing this under toolsmacorecord new macro

Of course that will save the file in the same folder everytime you run the
macro.

Regards,

Peo Sjoblom

"Shelly9633" wrote:

How do I write a macro to SaveAs? I want it to save the file as the same
filename it already has, but to put it in a different folder. Any help?


Chip Pearson

Try something like

ThisWorkbook.SaveAs filename:="H:\Temp\" & ThisWorkbook.Name

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Shelly9633" wrote in
message
...
How do I write a macro to SaveAs? I want it to save the file
as the same
filename it already has, but to put it in a different folder.
Any help?





All times are GMT +1. The time now is 02:17 AM.

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