Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Filename coding with date

At the end of my macros, I want to save my workbook to another folder with
another name. I want to save the file AS:

C:/Mydata/testfile_yyyymmdd,xls where yyyymmdd is the current date.

How do I code this in the macro.?

Thanks for your help.

Dean
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default Filename coding with date

strFileName = "testfile_" & Format$(Date, "yyyymmdd") & ".xls"
ThisWorkbook.SaveAs "C:\Mydata\" & strFileName


Steve


"DeanT" wrote in message
...
At the end of my macros, I want to save my workbook to another folder with
another name. I want to save the file AS:

C:/Mydata/testfile_yyyymmdd,xls where yyyymmdd is the current date.

How do I code this in the macro.?

Thanks for your help.

Dean



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Filename coding with date

Activeworkbook.SaveAs Filename:=Activeworkbook.Path & "\testfile_" &
Format(Date,"yyyymmdd") & .xls"

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"DeanT" wrote in message
...
At the end of my macros, I want to save my workbook to another folder with
another name. I want to save the file AS:

C:/Mydata/testfile_yyyymmdd,xls where yyyymmdd is the current date.

How do I code this in the macro.?

Thanks for your help.

Dean



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
Date and User restriction coding PSM[_19_] Excel Worksheet Functions 1 November 19th 09 07:03 PM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM
set excel <filename to <filename-date bob engler Excel Programming 2 July 12th 06 08:22 AM
VBA Coding: Date Consideration dzuy Excel Programming 1 June 30th 06 11:04 AM
Coding to show first _weekday_ prior to a date, when date calculation happens to fall on weekend? StargateFan[_3_] Excel Programming 5 December 9th 04 09:06 AM


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