Save as a date

neills

Board Regular
Joined
May 6, 2002
Messages
104
Hi All

Ive been looking everywhere to try and find out how to save my Spreadsheet to a directory with a date from a cell as a file name, the closest I came was with the macro below


Public Sub SaveAsA1()
ThisFile = Range("A1").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
End Sub

Thanks Neill
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi plettieri

I have tried this, and tried to adapt it, so that the date from the cell can be used because it may not always be the current date so I need it to do the same but with reference to the cell.

Or can I insert a function to B20 to change the date from B19 to a format similar to the one you mentioned (MMDDYY) ??????


Thanks Neill
 
Upvote 0
Thanks again

but this still will not work with various dates that can only be determined from cell B19

I am still trying everything I can think of but still I am unable to fathom it.

Neill
 
Upvote 0
just reference cell like this:

ActiveWorkbook.SaveAs FileName:=Format([b19] _
, "MMDDYY") & ".xls"
 
Upvote 0
Thanks Again

I always find the hard way just adapted some past posts with these to end up with

Dim TheName
TheName = Format([b19] _
, "MMDDYY")
ActiveWorkbook.SaveAs _
Filename:="H:\2004\Work In Progress\Delta Tracking\Tester\" & TheName, _
FileFormat:=xlNormal, _


But Yours is a whole lot better

Thanks Again

Learning is a long journey
 
Upvote 0

Forum statistics

Threads
1,202,976
Messages
6,052,882
Members
444,608
Latest member
Krunal_Shah

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top