Repeat date 9 times then move to next date

dscheetz21

New Member
Joined
May 24, 2017
Messages
1
I want to auto fill this date sequence:

1/1/17
1/1/17
1/1/17
1/1/17
1/1/17
1/1/17
1/1/17
1/1/17
1/1/17
1/2/17...

Basically, repeat the date X times, then move to the next date. I cannot for the life of me figure this out. It can't be that hard?!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Assuming you want these dates in column "A"

Try this vba script:

Code:
Sub Add_Dates()
Application.ScreenUpdating = False
Dim i As Long
Dim x As Long
x = 1
    For i = 1 To 366 * 9 Step 9
        Cells(i, 1).Resize(9).Value = DateAdd("D", x - 1, "1,1,2017")
        x = x + 1
    Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0
If you want the range formatted using the script:
Try this modified script:
Code:
Sub Add_Dates()
Application.ScreenUpdating = False
'Modified 5-25-17 12:46 AM EDT
Dim i As Long
Dim x As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
x = 1
    For i = 1 To 366 * 9 Step 9
        Cells(i, 1).Resize(9).Value = DateAdd("D", x - 1, "1,1,2017")
        x = x + 1
    Next
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:A" & Lastrow).NumberFormat = "D/M/YY"
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Or by formula:

Enter 1/1/17 in A1
Enter in A2 : =IF(MOD(ROW(),9)=1,A1+1,A1)
Fill down
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,518
Messages
6,125,293
Members
449,218
Latest member
Excel Master

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