View Single Post
  #2   Report Post  
Chip Pearson
 
Posts: n/a
Default

Try something like

If Range("M2").Value = TimeSerial(9,30,0) Then
' do something
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



<a wrote in message ...
hi,

case 1
i have this column, with time in US locale and in the format
H:MM , for
example, 9:30 in cell M2

My VBA code tries to compare

if range(M2).value = time(9,30,0) then DO SOMETHING

just fails to work..
---------------------

case 2,
when i tried to convert the whole column to text, 9:30 becomes
0.39583333,
the time serial code.
but its still useless when I write if range(M2).value =
0.39583333 then DO
SOMETHING




thnks.