Hello All,

I have a loop in a code I'm working on. It is suppose to find the largest date in a list. The test data I'm using has 12/28/2013 as the highest date. But when I run the code, every time, I get 9/7/2013 is the highest date. Is there any reason for this? I have put a break in the code to check to make sure it is reading the dates correctly. It came up with the if statement saying 12/28/2013 > 9/7/2013 = false. That made no sense to me. Does anyone know what could be causing the problem? Below is my code snippet for the loop.

While i < rowCount
            If (xlTempSheet.Cells(i, 12).Value > endDate) Then
                endDate = xlTempSheet.Cells(i, 12).Value
            End If
            i = i + 1
        Wend