View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
hailnorm[_6_] hailnorm[_6_] is offline
external usenet poster
 
Posts: 1
Default Macro to Save As with custom file name

I was just trying to bold it in the post. It's not included in th
macro.

The script creates a csv file called "FALSE" in the M:\2004 instead o
the M:\2004\Import\. Is there something that I'm missing??? Th
"Import2004" worksheet is formatted as text or number.


Patrick Molloy wrote:
*what are all those [b] 's ??
Tom didn't have them

Tom Ogilvy wrote:
Sub SaveSheet()
worksheets("Import2004").Copy
ActiveWorkbook.SaveAs Filename = "M:\2004\Import\" &
Activesheet.Range("A2").Value & Range("A5").Value & ".cvs",
FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
End Sub
--
Patrick Molloy
Microsoft Excel MVP
---------------------------------
"hailnorm " wrote i
message
...
Thanks Tom. But the following script always produces a file named
"FALSE.csv". Also, shouldn't---

Activesheet.Range("A2").Value & Range("A5").Value & _
[b]".cvs"[/B}, FileFormat:=xlCSV

be ... Value & _[b]".csv"[/B}, FileFormat:=xlCSV

The file still saves as "FALSE.csv" if I make the change. Is there
something that's missing???


Tom Ogilvy wrote:
[b]Sub SaveSheet()
worksheets("Import2004").Copy
ActiveWorkbook.SaveAs Filename = "M:\2004\Import\" & _
Activesheet.Range("A2").Value & Range("A5").Value & _
".cvs", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
End Sub



---
Message posted from http://www.ExcelForum.com/


--
Message posted from http://www.ExcelForum.com