PDA

View Full Version : [SOLVED] Macro to do one thing before 16:00 Hrs & something else after 16:00 hrs



mykal66
10-16-2013, 03:24 AM
I need to set up a spreadsheet with an button to create and send an email automatically which i can do but i also need it to do one thing before 16:00 hrs (today) and another 16:00 to 23:59. e.g. they press the button at 15:00 and a message box would display "Before 16:00 hrs): If they press it at 16:01 the message box would say "After 16:00 hrs). I've not really used time before and have no clue how to start.Thank you

p45cal
10-16-2013, 09:28 AM
try:

If Time > 16 / 24 Then MsgBox "after" Else MsgBox "before"

mykal66
10-16-2013, 12:14 PM
Thank you so much. I would have spent ages trying to figure this out but can now adapt what you gave me in no time at all. Really appreciated and thanks again