PDA

View Full Version : Solved: Save as 'todays date'



Blackie50
08-27-2010, 02:37 AM
Hi

I have a macro that does some stuff (creates a list of prices).

I am using the 'Application.Dialogs(xlDialogSaveAs).Show' to open the
save window after it finishes.

Is there a way to automatically make the 'File name' populate with yesterdays date and the 'save as type' default to Excel (the macro takes a text file as its source data so tries to save as text type.

thanks
Jon

Bob Phillips
08-27-2010, 03:12 AM
Application.Dialogs(xlDialogSaveAs).Show Format(Date - 1, "yyyy_mm_dd") & ".xls"

Blackie50
08-27-2010, 04:17 AM
Hi

Thanks for reply and almost there

Saves as "2010_08_26.xls" and doesnt change 'save as type'

Jon

Blackie50
08-27-2010, 06:57 AM
Strange - now it works

thanks again

Jon