• 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.

Reminders pop up based on time input in another cell

IKHAN

Member
Hi,

Is there a VBA code to pop up reminder message 15 mins before time provided in another cell and update original time after time lapse.

Have attached Test file with details.
 

Attachments

  • TestIK.xlsm
    23.4 KB · Views: 26
Thanks Chihiro for prompt reply.

Understand It's ideal to use email client, However for our work nv,email client isn't feasible, Coz worksheet gets passed on to other person after his\her shift is done.

So macro will assist user to intput date for last email sent and countdown should start based on current computer time and typed date and time.
 
Here's very basic code.

Sub StartTime() is assigned to the button to initiate the process.

eProcess is inserted into Workbook_BeforeClose to terminate Application.Ontime process before workbook is closed (otherwise, it will continue to run and may force open the workbook).

At set time, it will beep and pop-up will open, hitting OK will set next reminder time.
Hit Cancel and it will stop timer and record Date&Time in H2 as last email sent.

Code:
Sub StartTime()

Cells(2, 2) = Format(Time, "hh:mm AM/PM")
Cells(2, 8) = Format(Time + Cells(2, 6) / 24 - 15 / 24 / 60, "hh:mm AM/PM")
Call sProcess
End Sub

Sub sProcess()
Dim dTime As Date
Dim Ret_Type As Integer

dTime = Now + TimeValue("00:00:05")
Application.OnTime dTime, "sProcess", , True

If Time >= Cells(2, 8) Then
    Beep
    Ret_Type = MsgBox("Hit OK to set next Reminder, Cancel to stop Macro", vbOKCancel)
    Select Case Ret_Type
    Case 1
        Cells(2, 8) = Format(Time + Cells(2, 6) / 24 - 15 / 24 / 60, "hh:mm AM/PM")
    Case 2
        eProcess
        Cells(2, 4) = Now
    End Select
End If
End Sub

Sub eProcess()
Application.OnTime dTime, "sProcess", , False
End Sub

Edit: Woops, was missing a line in code.
 

Attachments

  • TestIK1 (1).xlsm
    26.3 KB · Views: 64
Last edited:
Back
Top