Use input as basis of what date to display

后端 未结 1 377
醉酒成梦
醉酒成梦 2021-01-27 05:34

I need a way to use the input on a userform to determine the date that will be displayed on the output. Here\'s my code:

If StatusBox.Value <= \"23:59\" And S         


        
相关标签:
1条回答
  • 2021-01-27 06:24

    This solution assumes the following:

    • StatusBox.Value is an Excel serial number formatted with a time format (no Date included) , as such StatusBox.Value is a decimal number with a value ranging from 0 (zero) to 0.99988426, representing the times from 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 P.M.). Therefore when this serial number reaches the 24 hours becomes 1 (one).

    Based on the above replace this:

    If StatusBox.Value <= "23:59" ...

    with this

    If StatusBox.Value <= 1 ...

    However if StatusBox.Value includes an [expected Date value] then use this as replacement line:

    If StatusBox.Value <= [expected Date value] ...

    0 讨论(0)
提交回复
热议问题