save workbook as the date content of a cell within a sheet

B

Brian

Hello,
Ron de Bruin helped me with this formula and thank you Ron.

ActiveWorkbook.SaveCopyAs "Patrol Log " & Format(Now, "mm-dd-yy h-mm-ss") &
".xls"

This saves the workbook upon exit with the current date but actually I would
like the date that is entered into cell b8 of sheet 1 to be the file name
saved.
ex: the phrase (Patrol Log) and the content of sheet 1 cell B8 (11-1-04)
Patrol Log 11-1-04. Right now with the formula above, it is saving the
workbook to the my documents folder. Can it be made to save to a different
folder of my choosing?

Thanks
Brian
 
R

Ron de Bruin

Hi Brian

Try this

Sub test()
With ActiveWorkbook
.SaveCopyAs "C:\Patrol Log " & _
Format(.Sheets("Sheet1").Range("B8"), "mm-dd-yy") & ".xls"
End With
End Sub
 

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