Vba or Fomulas to give me 4 dates from a start date and duration

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

Hoping someone can help with this,

I would like to input a start date and durration and get 4 dates equal weeks apart from that info.

So for example

D2= Start Date, (I input 01/July/2019)
D3= Duration in weeks (I Input 4 weeks)

So I would get the following dates in range G10:G13

G10 = 01/July/2019
G11 = 07/July/2019
G12 = 14/July/2019
G13 = 21/July/2019


that's all I need but I need it for any duration, so if its 7 weeks same thing etc.
please help if you can as I'm stuck
Thanks
Tony
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Place this macro in the worksheet code module, not in a standard module. Enter a date in D2 and then a number in D3 and press the RETURN key.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("D3")) Is Nothing Then Exit Sub
    Dim x As Long, y As Long: y = 6
    Range("G10") = Target.Offset(-1, 0)
    For x = 2 To Target.Value
        Range("G" & x + 9) = Target.Offset(-1, 0) + y
        y = y + 7
    Next x
End Sub
 
Upvote 0
How about


Book1
DEFG
201/07/201901/07/2019
3408/07/2019
415/07/2019
522/07/2019
Sheet1
Cell Formulas
RangeFormula
G2=$D$2+($D$3*7/4*(ROW(A1)-1))
 
Upvote 0
Thanks Fluff, that formula works perfectly,
Great VBA Mumps but gave me a date per week not divided by 4, but still be of use to me so thanks.
Big thank you

Tony
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,743
Messages
6,180,687
Members
452,994
Latest member
Janick

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