ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save file with date from cell (https://www.excelbanter.com/excel-programming/455162-save-file-date-cell.html)

Sabosis

Save file with date from cell
 
Hello

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?

Thanks

Sabosis

Save file with date from cell
 
On Friday, May 21, 2021 at 8:09:18 AM UTC-7, Sabosis wrote:
Hello

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?

Thanks

Sorry, meant the cell format is DATE

Peter T[_8_]

Save file with date from cell
 
"Sabosis"
On Friday, May 21, 2021 at 8:09:18 AM UTC-7, Sabosis wrote:
Hello

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?

Thanks

'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




All times are GMT +1. The time now is 08:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com