ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA: saving as with the name of the worksheet (https://www.excelbanter.com/excel-programming/300259-vba-saving-name-worksheet.html)

steve a

VBA: saving as with the name of the worksheet
 
I have an application where I receive an Excel workbook
from an ERP system. Each workbook has a unique name. I
want to save the workbooks to an established file
location. When I record a macro with using the Save As I
want the file to be saved with the unique name passed to
me. In the recorded macro the specific workbook name is
called out. example:
ActiveWorkbook.SaveAs Filename:= "C:\Documents and
Settings\My Documents\uniquename.xls" How do I make the
marco take the exact workbook name in insert it over the
uniquename.xls ... ie making it a variable? Does that
make since to anyone?

Tom Ogilvy

saving as with the name of the worksheet
 
ActiveWorkbook.SaveAs Filename:= "C:\Documents and
Settings\My Documents\" & Activeworkbook.Name

--
Regards,
Tom Ogilvy


"steve a" wrote in message
...
I have an application where I receive an Excel workbook
from an ERP system. Each workbook has a unique name. I
want to save the workbooks to an established file
location. When I record a macro with using the Save As I
want the file to be saved with the unique name passed to
me. In the recorded macro the specific workbook name is
called out. example:
ActiveWorkbook.SaveAs Filename:= "C:\Documents and
Settings\My Documents\uniquename.xls" How do I make the
marco take the exact workbook name in insert it over the
uniquename.xls ... ie making it a variable? Does that
make since to anyone?




No Name

saving as with the name of the worksheet
 
thank you Tom!
-----Original Message-----
ActiveWorkbook.SaveAs Filename:= "C:\Documents and
Settings\My Documents\" & Activeworkbook.Name

--
Regards,
Tom Ogilvy


"steve a" wrote in message
...
I have an application where I receive an Excel workbook
from an ERP system. Each workbook has a unique name. I
want to save the workbooks to an established file
location. When I record a macro with using the Save As

I
want the file to be saved with the unique name passed to
me. In the recorded macro the specific workbook name is
called out. example:
ActiveWorkbook.SaveAs Filename:= "C:\Documents and
Settings\My Documents\uniquename.xls" How do I make the
marco take the exact workbook name in insert it over the
uniquename.xls ... ie making it a variable? Does that
make since to anyone?



.



All times are GMT +1. The time now is 12:03 AM.

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