#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default File Naming

I wish to have a macro save a file name as a value within a cell. I'm not
sure where to go with this.

I figured I could select the range and set it as MyValue, then use the
savecopy as method, but I can't figure out how to get the MyValue in there as
the file name...

MyValue = Range("A1").Value
ActiveWorkbook.SaveCopyAs "C:\Documents and Settings\Desktop\MyValue.xls"

this is where I can't figure out how to get the MyValue in there as the
filename. If I put it like this, the file is saved as MyValue.xls
literally, and I want it to be the actual value within that range... Any
ideas? Thanks!!!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default File Naming

Maybe this:

MyValue = Range("A1").Value
ActiveWorkbook.SaveCopyAs "C:\Documents and Settings\Desktop\" & MyValue &
".xls"


"bodhisatvaofboogie" wrote:

I wish to have a macro save a file name as a value within a cell. I'm not
sure where to go with this.

I figured I could select the range and set it as MyValue, then use the
savecopy as method, but I can't figure out how to get the MyValue in there as
the file name...

MyValue = Range("A1").Value
ActiveWorkbook.SaveCopyAs "C:\Documents and Settings\Desktop\MyValue.xls"

this is where I can't figure out how to get the MyValue in there as the
filename. If I put it like this, the file is saved as MyValue.xls
literally, and I want it to be the actual value within that range... Any
ideas? Thanks!!!

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
Reverse naming of file kenppy New Users to Excel 2 March 5th 10 07:02 PM
Auto file naming Jacquesvv Excel Discussion (Misc queries) 1 June 23rd 09 02:57 PM
File naming conventions gidget Excel Discussion (Misc queries) 7 November 15th 05 02:15 PM
Naming a file with the same name as the folder Hari[_3_] Excel Programming 1 January 15th 05 10:06 PM
Naming File from a Cell RisingStar Excel Programming 1 August 10th 03 04:46 AM


All times are GMT +1. The time now is 04:26 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"