Live Auto-Clock and Popup Messages

drefiek

New Member
Joined
Jan 30, 2014
Messages
8
Good Morning,

I would appreciate help with the following as I've been stuck on it for days and can't seem to work it out. Google hasn't helped much either!

I've managed to set up a live auto-clock which displays live time as per my system time, to the second, using the following code in Sheet1 and a separate module. It works great.



Dim SchedRecalc As Date


Sub Recalc()


With Sheet1.Range("A1")


.Value = Format(Time, "hh:mm:ss")


End With


Call SetTime


End Sub


Sub SetTime()


SchedRecalc = Now + TimeValue("00:00:01")


Application.OnTime SchedRecalc, "Recalc"


End Sub


Sub Disable()


On Error Resume Next


Application.OnTime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False


End Sub



Now what I want is for popup message boxes (requiring just an 'OK' click) to appear when that live clocks reaches certain times. I've tried everything I am aware of like the following but it just won't work. When I run the macro on it's own it works, it's just when I try to link it to the other codes it won't work.

Private Sub Popup1()
If cell(A1) = "08:55:00" Then
Run "Popup"
End Sub

Any ideas please?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Maybe try:

Rich (BB code):
Sub Recalc()
    With Sheet1.Range("A1")
        .Value = Format(Time, "hh:mm:ss")
        If .Value = "08:55:00" Then
            MsgBox "It's five to nine"
        End If
    End With
    Call SetTime
End Sub
 
Upvote 0
Hi Andrew,

Thanks for the speedy response!

However the additional code you suggested doesn't work. I set it up for a few minutes ahead and waited but no message popped up :(

Regards,
Keifer
 
Upvote 0
It's to do with pesky formats.


Try this


If Format(.Value, "hh:mm:ss") = "10:07:00" Then



I tried and it worked for me
 
Upvote 0
Hi all,

I have a final little request for help.

Now I have the auto live clock in and working with popups at certain times, I now want to apply a certain message popup to a cell that ONLY requires filling in on a Tuesday at 9am. The cell is E36. So I want the popup only to be displayed on a Tuesday at 9am. I think to make this work Excel would need to know that today is a Tuesday, maybe by referring to the system date and time (as it does for the live clock).

Any help would be greatly appreciated again.

Many thanks,
Keifer
 
Upvote 0
Hi Keifer


I don't understand what you mean by this "...certain message popup to a cell that ONLY requires filling in on a Tuesday at 9am. The cell is E36......".


You mean you would like the message to say "Oi, you, yes you!! Fill in Cell E36 now and I mean NOW!!!"?
 
Upvote 0
Hi Stiuart_W,

Sorry my fault, I was rushing and didn't word it very well!

Basically there is a cell (E36) which should only be filled in on a Tuesday at 9am. If I set up the popup message as per the above, to popup at 9am, it will show up every day at 9am... so I need an additional code to make it so that it only popups up on a Tuesday.

Hopefully that makes a bit more sense!

Regards,
Keifer
 
Upvote 0
Try this Kiefer

Code:
Sub Recalc()
    DayToday = WeekdayName(Weekday(Now()), , vbSunday)
    With Sheet1.Range("A1")
        .Value = Format(Time, "hh:mm:ss")
            If Format(.Value, "hh:mm:ss") = "15:32:00" And DayToday = "Tuesday" Then
                MsgBox "Fill in E36 you gimp"
            End If
    End With
    Call SetTime
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,453
Messages
6,124,930
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top