View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Peter T[_8_] Peter T[_8_] is offline
external usenet poster
Posts: 88
Default Save file with date from cell

On Friday, May 21, 2021 at 8:09:18 AM UTC-7, Sabosis wrote:

I have a macro that saves my workbook to a location on the network, but I
would like to add the date to the filename, with that date coming from the
value in cell F2. The current format for that cell is Data, but the
filename will not accept "/". I would want the date format to be mmddyy.
Any ideas?


'Sorry, meant the cell format is DATE

Just one of many ways -

MsgBox Date & " = " & Format(Date, "yymmdd")

I add dates to files like that for sorting, but adapt to your mmddyy. This
of course assumes your cell value really is a numeric date, or can be
coerced to a date.

Peter T