Moose,
You were very close with your last post:
[vba]
Sub myMacro()
Dim i As Integer
Dim k As Integer
i = 1
k = 1
Do While Cells(i, 4) <> ""
DoWhile Cells(k, 3) <> ""
If Cells(i, 4) - Cells(k, 3) >= 365 Then Cells(k, 5) = 0
k = k + 1
Loop
i = i + 1
Loop
End Sub
[/vba]
You need to change 2 things...
First, You set i and k = 1, and when it runs the loop, since cell 1,4 is empty, it considers that loop done... if you set i and k = 2, it will loop...
Second, when subtracting the two values, you need to at the minimum convert them to longs, but better use the function I put at the top of this thread (Teeroy is correct, remove the clear contents because you obviously do not want that). I would not use the minimum date, as you are not directly comparing the two items you want to compare... so if dates in the second column could be before dates in the first, this may not work correctly...
so, second part you need to do is call the function in the loop IE change
If Cells(i, 4) - Cells(k, 3) >= 365 Then Cells(k, 5) = 0
to
If daysdiff(cells(i,4), cells(k,4))>=365 then
Good luck, and let us know how it goes...