Pop-Up Message Using VBA

LaurenAshworth95

New Member
Joined
Jan 17, 2023
Messages
1
Office Version
  1. 2021
Platform
  1. Windows
Good afternoon all,

I have a workbook and in one of the sheets I need to run a code that will give me a pop up when the value in a box changes and is still >0. I should mention that the box I need to monitor is a formula so I am monitoring the formulas value rather than the formula itself. I have the below which works however when just one formula value changes it gives me a pop up per value. So I change one formula value and get 7 pop ups. I can attach the spreadsheet if needed. Here is the code I am using:

Private Sub Worksheet_Calculate()
Dim r As Range
For Each r In Range("AF4:AF15678")
If r.Value > 0 Then
MsgBox "Please note there are outstanding kits to be returned on this order. Please confirm any remaining returns with customer or BD representative"
End If
Next r
End Sub

Thank you for any help you can provide.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Welcome to the Board!

The issue with the Worksheet_Calculate is that all it can detect that a calculation was updated SOMEWHERE on the sheet. It has no way of telling which cell had the calculation.

Are you actually changing the formula itself, or is it just the value that it is returning that is changing?
If you are manually changing the formula, then you can use the Worksheet_Change event procedure instead, in which you can detect exactly which cell you updated.
If it is the value that is changing (and not the formula), I think we need to come up with a different plan.

What does this formula look like?
Is the value changing because the underlying values are being updated?
If so, how exactly are these underlying values being updated?
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,384
Members
449,080
Latest member
Armadillos

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