How do I create a popup notification in excel ?

B

Bear Hunter

I use an excel workbook to keep track of trips (mileage, stops, fuel, oil
changes, ect....). I want to creat a popup notification for oil changes that
monitors a range of cells and pops up when mileage is reached. I created the
workbook myself and always trying to improve it.
 
B

Bob Phillips

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H10" '<=== change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value > 100 Then
MsgBox "Target reached"
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
B

Bear Hunter

Thanks Bob for your responce, but I don't know anything about working with
code, just an novice with excel, don't know what values in the code to change
to fit my needs. Thanks again, anyway.
 
B

Bob Phillips

Tell us what cell you want to monitor, and what value will trigger the
popup.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
B

Bear Hunter

OK, I want to monitor 2 ranges; F3:F40 , if any one of then = "PM Service"
then I want to use value in corresponding cell in range C3:C40, then add set
value 15000, when value in Range C3:C40 reaches that total value I want a
popup reminder that it is "Time for an oil change". This will need to work
across multiple workbooks, I hope.
 
B

Bob Phillips

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "C3:C40" '<=== change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Offset(0,3).Value = "PM Service" Then
If .Value > 15000 Then
MsgBox "Time for an oil change"
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

For multiple workbooks, you need to add to each.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
B

Bear Hunter

This works, but it works with any entry I put in column c, It doesn't wait
till the value in column c is + 15000. It works if "PM Service" is entered
first in col "F" With any number above 15000 entered In corresponding col
"C". Col "C" is odometer readings and I trying to be reminded when a "PM
Service" is due. I really want to thank you for your help, I have gotten
further than I would have on my on, but I have to go to work now. I'll check
back in a few days. Thanks again.
 
B

Bob Phillips

Bear Hunter said:
This works, but it works with any entry I put in column c, It doesn't wait
till the value in column c is + 15000. It works if "PM Service" is entered
first in col "F" With any number above 15000 entered In corresponding col
"C".

Those two statements seem contradictory to me. One says it works in all
instances, one says it works only in defined instances.
 
B

Bear Hunter

Col. C Col.F
240500 PM Service
248000 Next Stop
255500 Need Popup at this point
"this is a very basic example"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top