How to save files in date order eg 1 Sep, 2 Sep without doing them individually

Thickas

New Member
Joined
Aug 28, 2018
Messages
2
Hi
I'd be thankful for any help.
I am wanting to write 01/9/2018 in cell A1 then save it as 01/09/2018.
I then want to open a new spreadsheet and write 02/09/2018 in cell A1 and save it as 02/09/2018
Then 3rd Sept etc all the way down to 30 September. Etc Etc.
At the moment, i am having to do one file at a time.

Is there any way I can just do the first one and somehow have it do all the work for me, so that I am
left with one file for each day, with each file having its date in cell A1?

Please keep it simple.
I'm as thick as pig****, hence my username.

Thickas
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi,

Create a new workbook, and in A1 down in Sheet1 write the dates you want (enter a date in A1, then drag down the cell).

Then run this (just amend the file location)

Code:
Option Explicit

Sub Createbooks()


Dim datestr As String
Dim rownum As Long
Dim Wk As Workbook
Application.DisplayAlerts = False


rownum = 1
Do Until Sheets("Sheet1").Cells(rownum, 1).Value = ""
datestr = Sheets("Sheet1").Cells(rownum, 1).Value


Set Wk = Workbooks.Add
Range("A1").Value = datestr
datestr = Replace(datestr, "/", ".")
Wk.SaveAs Filename:="\\epping\public$\\AndrewM\" & datestr & ".xlsx"  ''update file location
Wk.Close


rownum = rownum + 1
Loop
Application.DisplayAlerts = True


End Sub
 
Last edited:
Upvote 0
That looks very promising.
After I have amended the file location, where/how do I past the routine ?
 
Upvote 0
Go to File > Options > Customize Ribbon, and tick the Developer button on the right. Select Ok.

Press Alt + F11 to open the VB studio.

On the left, right click on ThisWorkbook, go to Insert and click Module

Paste in the code, press F5 to run it
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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