Hi -
You can start from this;
Sub test()
Dim oldDate As Date, ndx As Integer
oldDate = "1/1/1970"
ndx = 1
For Each sht In Worksheets
If InStr(sht.Name, "INV") > 0 Then
txt = Replace(sht.Name, "INV", vbNullString)
y = Left(txt, 4): m = Mid(txt, 6, 2): d = Mid(txt, 9, 2): t1 = Mid(txt, 12, 2): t2 = Right(txt, 5)
If Format(m & "/" & d & "/" & y & " " & t1 & ":" & t2, "m/d/yyyy hh:mm AM/PM") > oldDate Then
oldDate = Format(m & "/" & d & "/" & y & " " & t1 & ":" & t2, "m/d/yyyy hh:mm AM/PM")
ndx = sht.Index
End If
End If
Next
Sheets(ndx).Select
End Sub
Regards,
event
Bookmarks