save as issue

J

jatman

good morning,

once again i am back because all of the help that i have recieved before
cannot help me out again.

i am using Office 2007, and have a work schedule that works. i want to make
a macro that emails out a copy, and saves a copy in c:/files

the issue revolves around the date. the date displays in the format
yyyy-mm-dd but in the formula bar is shows as dd/mm/yyyy. i want to save the
file with the same format and date that shows in cell B2 (yyyy-mm-dd).

i found the code below:

Dim fname as String
With ActiveWorkbook.worksheets(1)
fname = format(.Range("B2").Value,"yyyymmdd") & ".xlsx"
.SaveAs fname
End With

but when it goes to save the files, it saves the file name as 18991230 but
the date in the cell B2 is April 02, 2008.

if i can get past this issue, i think i can get the rest of the code written
myself. any help on this is appreciated.

thank you,
 

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