Save or open file as YYYYMMDD in Macros, how to record it

G

Guest

In Macros, I would like to save or open file name as YYYYMMDD or pickup name
from a cell where date is mentioned as =today() with format as YYYYMMDD. or
any other alternative to pick up the file with naming convention as mentioned
above.
 
D

Dave Peterson

Activeworkbook.saveas filename:=format(date,"yyyymmdd") & ".xls", _
fileformat:=xlworkbooknormal

Is one way to save a workbook with today's date. I didn't give it a folder
location--so it'll save to the current folder (whatever that might be!).

dim wkbk as workbook
set wkbk = workbooks.open(filename:=format(date,"yyyymmdd") & ".xls")

would be a way to open a workbook in the current folder that has today's date as
the name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top