• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Updating of caption based on value in Label

hayden_pinto

New Member
Hi


I have an excel VB user form that has the time mentioned in a Lable1


what i need is a code to use in vb so when the lable1 value is greater than 2:30pm then it should update caption1 as "Late" if not then "on time"


i have got a formula in excel that works

=IF(H2<(TIME(14,00,0)),"Late","On time")


how do i insert this in VB
 
Hi, hayden_pinto!


In VBA it's:

If Now() > #2:30:00 PM# Then userform.Caption = "Late" Else userform.Caption = "On time"


Regards!
 
Back
Top