smartpat19
Board Regular
- Joined
- Sep 3, 2014
- Messages
- 114
I have two dates and i am trying to create a dynamic date range based on those two dates.
in cell E5 is my starting date and E7 is my ending date. I have a formula to count the number of months between the dates in Y8="IFERROR(DATEDIF(E5,E7,"m"),0)"
I cannot get the end of range to copy my Edate formula. Or if there is a way to avoid using Y8's fromula that would be ideal.
Thank you ahead of time!
in cell E5 is my starting date and E7 is my ending date. I have a formula to count the number of months between the dates in Y8="IFERROR(DATEDIF(E5,E7,"m"),0)"
I cannot get the end of range to copy my Edate formula. Or if there is a way to avoid using Y8's fromula that would be ideal.
Code:
Sub Update_Actuals()
Dim job As Worksheet
Dim column As Range
Dim columncount As Long
Set job = ThisWorkbook.Sheets("Job Cost Query")
job.Range("AF13").Formula = "=E5"
column = job.Range("Y8").Value
Set columncount = column + 14
Date = job.Range("AG13").Formula = "=EDATE(AF13,1)"
Date.Copy
Set daterange = job.Range(Cells(34.13), Cells(columncount, 13)).Paste
End Sub
Thank you ahead of time!