I have a worksheet with columns Year, Month, Day and Hour. I need to combine it to date.
On the workshhet, I used the formula date(A1,B1,C1) + time(D1,0,0) and it worked fine. I would like to know how to do this in a macro.
I used the attached code, but it returns the value as 1/0/00 0:00. Any ideas ?
Dim i As Integer
Dim intLastRow As Integer
intLastRow = Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To intLastRow
Range("L" & i) = "=date(A&i,B&i,C&i)+time(D&i,0,0)"