Prior to my problem area, I receive two dates from a form which I then determine the difference between them.
On my worksheet I need to take the formula that resides in "J2" and copy it to the column count of daycount
ie. If daycount = 2 , then copy the formula in J2 over to K2 and L2.
My latest attempt was:
Which did not work
I have tried numerous variations of autofill, xltoleft, xltoright, up, down turn around, bang my head on the desk but can not get it right in my head
Hope the above makes sense.
Code:
Dim dayCount As Integer
dayCount = DateDiff("d", Date_Selection.sDate.Value, Date_Selection.eDate.Value)
On my worksheet I need to take the formula that resides in "J2" and copy it to the column count of daycount
ie. If daycount = 2 , then copy the formula in J2 over to K2 and L2.
My latest attempt was:
Code:
Worksheets("Master_Week").Range("J2", Cells("J2", Cells(2, Columns.Count).End(xlToLeft).Column + dayCount)).Formula = Range("J2").Formula
I have tried numerous variations of autofill, xltoleft, xltoright, up, down turn around, bang my head on the desk but can not get it right in my head
Hope the above makes sense.