If I have a worsksheet with:
Range("A1") = 11:30 PM and it is formatted to Time in A1, and I want to know if the NOW time is less than or equal to 5 minutes passed the time in cell A1, how the heck do I do that using VBA?
I'm taking Msgbox readings now from my cell value in A1 and it says: 130.34532452 where I would expect it would say 11:30PM? I cant get it to do any math that makes any sense using NOW with it either? I'd like to do something like:
Obviously that code exactly doesn't work but something like that is what I want to do.
Thank You for any help!
Matt
Range("A1") = 11:30 PM and it is formatted to Time in A1, and I want to know if the NOW time is less than or equal to 5 minutes passed the time in cell A1, how the heck do I do that using VBA?
I'm taking Msgbox readings now from my cell value in A1 and it says: 130.34532452 where I would expect it would say 11:30PM? I cant get it to do any math that makes any sense using NOW with it either? I'd like to do something like:
Code:
If Range("A1") - Now > 5 Then
Msgbox "It's beyond 5 minutes"
Else
Msgbox "It's only been " & Now - Range("A1") & " minutes."
End If
Obviously that code exactly doesn't work but something like that is what I want to do.
Thank You for any help!
Matt