I hope you can help. I have a small piece of code below. The issue I am having is that I am trying to subtract today's date from the date in Column T and then return a numerical result in Column U and then continue this formula down Column U until there is no values left in column T to subtract against.
So today's date is 01/07/2018 I want to subtract this date from the date in C2 06/07/2017 giving me 185 in U2 and then continue this through column U until T has a blank cell.
The piece of code that is bugging is .Range("U" & i).Value = DateDiff("u", .Range("T" & i).Value, Date)
The error I get is run time error 5 Invalid Procedure call ur argument
Dim LastRow As Long, i As Long
With Worksheets("Allocation")
LastRow = .Cells(.Rows.Count, "T").End(xlUp).Row
For i = 2 To LastRow
.Range("U" & i).Value = DateDiff("u", .Range("T" & i).Value, Date)
Next i
End With
So today's date is 01/07/2018 I want to subtract this date from the date in C2 06/07/2017 giving me 185 in U2 and then continue this through column U until T has a blank cell.
The piece of code that is bugging is .Range("U" & i).Value = DateDiff("u", .Range("T" & i).Value, Date)
The error I get is run time error 5 Invalid Procedure call ur argument
Dim LastRow As Long, i As Long
With Worksheets("Allocation")
LastRow = .Cells(.Rows.Count, "T").End(xlUp).Row
For i = 2 To LastRow
.Range("U" & i).Value = DateDiff("u", .Range("T" & i).Value, Date)
Next i
End With