ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save As (https://www.excelbanter.com/excel-programming/397660-save.html)

tc

Save As
 
hi. i have a worksheet which contains a name in a particular cell. is
it possible to create a macro that will use this name and save a copy
of the workbook with that name?


JW[_2_]

Save As
 
This doesn't specify a path unless that is in your cell with the
filename. But you can always add that into the code.
Sub foo()
ThisWorkbook.SaveAs Range("A1").Text
End Sub
tc wrote:
hi. i have a worksheet which contains a name in a particular cell. is
it possible to create a macro that will use this name and save a copy
of the workbook with that name?



JW[_2_]

Save As
 
Also, if you are storing your code in a separate workbook, you will
need to use ActiveWorkbook instead of ThisWorkbook.
JW wrote:
This doesn't specify a path unless that is in your cell with the
filename. But you can always add that into the code.
Sub foo()
ThisWorkbook.SaveAs Range("A1").Text
End Sub
tc wrote:
hi. i have a worksheet which contains a name in a particular cell. is
it possible to create a macro that will use this name and save a copy
of the workbook with that name?




All times are GMT +1. The time now is 10:40 AM.

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