Thread: File Naming
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default File Naming

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


--
Don Guillett
SalesAid Software

"bodhisatvaofboogie" wrote in
message ...
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!!!