![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 05:35 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com