1

This is just nuts.

I have a cell (in excel) in which I type "23:50" (without quotes). Next, with this cell selected, I go to the immediate window and type

msgbox activecell = timevalue("23:50")

..and it gives me "FALSE"!

I get TRUE for everything else, for eg with 23:49 or 23:51 (or any other time for that matter) in the cell and correspondingly in the code, but with 23:50 its breaking down for no reason.

This line is part of a bigger code, where this condition needs to be TRUE for the rest of it to execute. Using Excel 2007 on Win 7.

Community
  • 1
  • 1
MarioTheHedgehog
  • 306
  • 4
  • 12

1 Answers1

5

Test with this instead:

timevalue(activecell.text) = timevalue("23:50")

Likely your mismatch is due to the numeric equivalents not matching exactly:

      activecell.value = 0.99305555555555_5_

but

cdbl(timevalue("23:50"))=0.99305555555555_6_
Tim Williams
  • 154,628
  • 8
  • 97
  • 125