Thread: Find time
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Martin Los Martin  Los is offline
external usenet poster
 
Posts: 1
Default Find time

In column A I have:
Cell Content
A1 Hour
A2 7:00
A3 7:30
A4 8:00
A5 8:30
A6 9:00
A7 9:30
A8 10:00
A9 10:30
A10 11:00
A11 11:30
A12 12:00
A13 12:30
A14 13:00
A15 13:30
A16 14:00
A17 14:30
A18 15:00
A19 15:30
A20 16:00
A21 16:30
A22 17:00
A23 17:30
A24 18:00
A25 18:30
A26 19:00
A27 19:30
A28 20:00
A29 20:30
A30 21:00
A31 21:30
A32 22:00
A33 22:30
A34 23:00

In VBA macro I have:
Sub prueba()
Columns("A:A").EntireColumn.Select
On Error Resume Next

intRowBegin = 0
With Selection
intRowBegin = .Cells.Find(What:="22:30", _
LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext).Row
Debug.Print intRowBegin
End With
End Sub

The result is that intRowBegin = 0 for all values from
12:30 until 23:00. These timevalues will NOT be found with
the find command. Values from 07:00 until 12:30 do get
find with the macro.

What am I doing wrong? Any help apreciated?

TIA Martin