Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help in macro coding Sasikiran Excel Discussion (Misc queries) 3 March 24th 10 02:34 PM
Filename coding with date DeanT Excel Programming 2 November 28th 06 11:23 PM
Implant macro coding into ASP coding Sam yong Excel Programming 5 September 15th 05 10:37 AM
Need VB Coding Help for a Macro Trevor Shuttleworth Excel Programming 0 August 26th 04 08:39 PM
macro coding Andrew[_37_] Excel Programming 1 July 28th 04 06:06 AM


All times are GMT +1. The time now is 06:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"