How to find the days difference between two dates [closed]

Instead of using vba just enter the formula for the first row on C1 :


Then just the formula to the end of exisiting rows.

If you insist using vba code use the simple code below:

   Dim LastRow As Long
LastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row

    ActiveCell.FormulaR1C1 = "=ROUND(RC[-1],0)-ROUND(RC[-2],0)"
    Range("c1").AutoFill Destination:=Range("C1:C" & LastRow)
End Sub

Browse More Popular Posts

Leave a Comment