ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   popup message (https://www.excelbanter.com/excel-programming/383998-popup-message.html)

KYaeger

popup message
 
I would like a popup message to inform the user that the budgeted value they
entered in a cell is larger than 1.0825 times the old amount. This is for
departments submitting budget for 2007 and there is a cap of 8.25% on
increases. The message box would serve as a reminder to them when they are
going over the budget limits.

merjet

popup message
 
The specs could be more complete, but you can start with the
following. It assumes the budgeted amount is entered in cell B2 and
the prior year's amount is in cell A2. Maybe you need to use
Target.Column or Target.Row in place of Target.Address. Put this in
the worksheet's code module.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$2" Then
If Target 1.0825 * Range("A2") Then
MsgBox "Amount entered may not exceed 1.0825 times prior
year's budget."
Target = ""
End If
End If
End Sub

Hth,
Merjet



All times are GMT +1. The time now is 08:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com