ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Working with times as conditions in formulas (https://www.excelbanter.com/excel-discussion-misc-queries/235625-working-times-conditions-formulas.html)

NDBC

Working with times as conditions in formulas
 
I have now located the times. Thanks for your help with the last post. This
line is giving me a type mismatch error. When I check the values by holding
my mouse over them in debugger it has Time2.text in h:mm:ss format and
lastlap and Range(c14) as 0.000567 (time in non time format). Is this the
cause of the error and if so what is the asiest way to put time2.text into
number format.

If Time2.Text - lastlap 1.4 * Range("c" & riderCell.Row) Or Time2.Text -
lastlap < 0.4 * Range("c" & riderCell.Row) Then

Thanks

OssieMac

Working with times as conditions in formulas
 
If my interpretation of your question is correct then TimeValue(time2.text)
should return a proper time value.

--
Regards,

OssieMac


"NDBC" wrote:

I have now located the times. Thanks for your help with the last post. This
line is giving me a type mismatch error. When I check the values by holding
my mouse over them in debugger it has Time2.text in h:mm:ss format and
lastlap and Range(c14) as 0.000567 (time in non time format). Is this the
cause of the error and if so what is the asiest way to put time2.text into
number format.

If Time2.Text - lastlap 1.4 * Range("c" & riderCell.Row) Or Time2.Text -
lastlap < 0.4 * Range("c" & riderCell.Row) Then

Thanks


NDBC

Working with times as conditions in formulas
 
OssieMac you are a champion. You deserve gold status. Thanks heaps. Worked a
treat.

"OssieMac" wrote:

If my interpretation of your question is correct then TimeValue(time2.text)
should return a proper time value.

--
Regards,

OssieMac


"NDBC" wrote:

I have now located the times. Thanks for your help with the last post. This
line is giving me a type mismatch error. When I check the values by holding
my mouse over them in debugger it has Time2.text in h:mm:ss format and
lastlap and Range(c14) as 0.000567 (time in non time format). Is this the
cause of the error and if so what is the asiest way to put time2.text into
number format.

If Time2.Text - lastlap 1.4 * Range("c" & riderCell.Row) Or Time2.Text -
lastlap < 0.4 * Range("c" & riderCell.Row) Then

Thanks



All times are GMT +1. The time now is 02:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com