View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_4_] Patrick Molloy[_4_] is offline
external usenet poster
 
Posts: 103
Default Macro to Save As with custom file name

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 in 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/