Hi,
I have a macro which searches for the latest date down a column and across particular rows. Extract of the code is shown below:
Dim LR As Long, i As Long, Val As String
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LR
If Cells(i, "B") = "Sentence Process" Then _
If Cells(i, "D") > Val Then Val = Cells(i, "D")
Next i
Range("G1") = Val
The problem is that it keeps returning the highest day not dates, for example say 16/06/09 and 03/07/09 are both in the same results the value which is displaying is 16/06/09.
I believe this is beacuse 16 is higher than 3, and the code is ignoring the fact that it is a date.
Any ideas?
Thanks again all!
Bookmarks