Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Coding a filename into a macro
Hi,
I want to be able to move a selection of sheets to a new workbook, and name the file (this does not change so I would declare this as a string - I think), however, I would like the newly created file to be saved in the current directory (the directory of the original file). How can I do this? Also, In case I don't figure it out, what is the code for setting the filename in the macro? kind regards, Matt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Coding a filename into a macro
One way:
Const csFILENAME As String = "MyBook.xls" With ThisWorkbook .SaveAs Filename:=.Path & Application.PathSeparator & csFILENAME End With In article . com, "Guerilla" wrote: Hi, I want to be able to move a selection of sheets to a new workbook, and name the file (this does not change so I would declare this as a string - I think), however, I would like the newly created file to be saved in the current directory (the directory of the original file). How can I do this? Also, In case I don't figure it out, what is the code for setting the filename in the macro? kind regards, Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help in macro coding | Excel Discussion (Misc queries) | |||
Filename coding with date | Excel Programming | |||
Implant macro coding into ASP coding | Excel Programming | |||
Need VB Coding Help for a Macro | Excel Programming | |||
macro coding | Excel Programming |