LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default How to add Date Stamp to SaveAs "file name" within VBA for Excel?

I have written some VBA code to pull several columns from an Excel
spreadsheet and save these in their own file of *.csv format. However, the
end users would greatly benefit from having the saved date as part of the
filename. I've tried several different methods in my code, but, none are
working. The rest of the code works as intended (I get the new file created
and saved with the new filename).

The relevant code is as follows:

Workbooks.Add
Windows(Sheet_Name).Activate
Cells.Select
Selection.Copy
Workbooks("Book1").Worksheets("Sheet1").Activate
Cells.Select
ActiveSheet.Paste
Sheets(Sheets.Count).Name = "Crimson_Info"
ActiveWorkbook.SaveAs
Filename:="\\Cmc-thor\Infosystems\Projects\Crimson\Crimson_Info.csv ",
FileFormat:=xlCSV


 
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
Macro path follows the "SaveAs" file OlieH Excel Programming 1 March 3rd 07 01:50 AM
How can I put/insert a "Paid" stamp on an invoice created in Excel Jon Peltier Excel Discussion (Misc queries) 0 November 22nd 06 01:47 AM
SaveAs macro: How do I specify "Replace existing file?" [email protected] Excel Programming 1 May 24th 05 02:36 AM
How do I put a "date & time saved" stamp inside an Excel Wksht? Bill Excel Programming 1 May 12th 05 05:03 PM
How do I put a "date & time saved" stamp inside an Excel Wksht? Mangesh Yadav[_2_] Excel Programming 0 May 10th 05 12:20 PM


All times are GMT +1. The time now is 09:42 PM.

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

About Us

"It's about Microsoft Excel"