Reminder code for next

baha17

Board Regular
Joined
May 12, 2010
Messages
183
Hi All,
I am trying to create a some sort of reminder inside the excel file. Basically it works with on time event then trigers the code called "CheckReminder". I can call the code no problem. There is a option for users to dismiss or snooze, that part is a bit of mess. When the user choses to dismiss it works properly and goes the next item, but if the user choses "no"(that means to snooze" because of "exit sub" the code dies right there. I could not thing of the logic, anyone to give a hand? FYI, excel is my only option for this cannot use outlook:). Thanks in advance.
Baha
Here is my code:

Code:
Sub CheckReminder()
Dim cel As Range
Dim Prompt, Buttons, Title, Help, Ctxt, Response, MyString
Buttons = vbYesNo + vbCritical + vbDefaultButton1
Title = "CALLING FOR REMINDER"
For Each cel In Sheets("Reminder").Range("G:G")
Prompt = "There is a reminder about: " & Chr(13) _
& " { " & cel.Text & " }" & " on " & cel.Offset(0, 1) & " at " & Format(cel.Offset(0, 2), "HH:MM") _
& Chr(13) _
& "Please Click YES to Dismiss , Click NO to Snooze"
If cel <> "" And cel.Offset(0, 3) = "" Then
Response = MsgBox(Prompt, Buttons, Title, Help, Ctxt)
If Response = vbYes Then
GoTo 20
Else
Exit Sub
End If
20 cel.Offset(0, 3) = "dismissed"
End If
Next cel
End Sub
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi Again,

I fixed the code:)as below:

Code:
Sub CheckReminder()
Dim cel As Range
Dim Prompt, Buttons, Title, Help, Ctxt, Response, MyString
Buttons = vbYesNo + vbCritical + vbDefaultButton1
Title = "CALLING FOR REMINDER"
For Each cel In Sheets("Reminder").Range("G:G")
Prompt = "There is a reminder about: " & Chr(13) _
& " { " & cel.Text & " }" & " on " & cel.Offset(0, 1) & " at " & Format(cel.Offset(0, 2), "HH:MM") _
& Chr(13) _
& "Please Click YES to Dismiss , Click NO to Snooze"
If cel <> "" And cel.Offset(0, 3) = "" Then
Response = MsgBox(Prompt, Buttons, Title, Help, Ctxt)
If Response = vbYes Then
GoTo 20
Else: GoTo 30
'Exit Sub
End If
20 cel.Offset(0, 3) = "dismissed"
End If
30 Next cel
End Sub
Thanks anyway
Baha
 
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,103
Members
452,379
Latest member
IainTru

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