How to save workbook with timestamp in its name using VBA in Excel

preview_player
Показать описание
In this tutorial you will learn how to save workbook with timestamp in its name using VBA macro programming in Microsoft Excel

VBA Code:

'This code will Save the File With a Timestamp in its name
Sub SaveIt()
Dim DateTimeSuffix As String, WorkBookName As String
WorkBookName = "d:\Data_"
DateTimeSuffix = Format(CStr(Now), "yyyy-mm-dd-hh-mm-ss")
ActiveWorkbook.SaveAs Filename:=WorkBookName & DateTimeSuffix
End Sub
Рекомендации по теме
Комментарии
Автор

Hi, this video was helpful thanks. How do I save a file from one folder to another folder with today's date please?

lila-x
Автор

nice tutorial. this helped me a lot in my workplace. thank you for sharing the knowledge

Pedalsandrides
Автор

If I want to rename an existing file to a new file name with the date is that possible?

Example, old name is ABC. Then new name is ABC_10/02/2023

daffaajifirmansyah
Автор

Hi!
Could u plz help me in saving file with current date in pdf form

saadi_lab
Автор

Your video was so useful. Thanks bro! I need to change the format.csv and notepad. Can you help me pls…

smilechristhu
Автор

Hi sir, i need to save the files with time stap and file name series as A1, A2, A3 etc everytime I save.

gaurijadhav
Автор

Thank you for the code but when changing the "-" to "." in date it is not saving properly.

saravanakumarb
Автор

what If you only need date stamp and not time stamp.

amzy
Автор

I need to save a excel in two formats eg:- Name dd-mm-yyyy, Kindly help

saravanakumarb
visit shbcf.ru