Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message Box if sum is above 30
If A3, B3 and C3 in a sheet add up to over 30 I would like to automatically
warn the user with a message box. Is it possible to put the amount these three cells add up to as well? If these cells add up to 30 or less then I don't want anything to happen. Any help would be appreciated. Thank you. --Elaine |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message Box if sum is above 30
I find just using a cell close to those other cells the best way to tell the
users: Maybe D3??? =if(sum(a3:c3)<=30,"","Too much in A3:C3!") I'd format it in big bold red letters. Elaine wrote: If A3, B3 and C3 in a sheet add up to over 30 I would like to automatically warn the user with a message box. Is it possible to put the amount these three cells add up to as well? If these cells add up to 30 or less then I don't want anything to happen. Any help would be appreciated. Thank you. --Elaine -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message Box if sum is above 30
Are A3, B3 and C3 constants or formulas or a mixture of the two?
-- HTH... Jim Thomlinson "Elaine" wrote: If A3, B3 and C3 in a sheet add up to over 30 I would like to automatically warn the user with a message box. Is it possible to put the amount these three cells add up to as well? If these cells add up to 30 or less then I don't want anything to happen. Any help would be appreciated. Thank you. --Elaine |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message Box if sum is above 30
Here is some code to try. It is a bit overkill if you only have constants in
A3:C3 but it will work. Place this code directly in the sheet (Right click the sheet tab and select view code) Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range On Error Resume Next Set rng = Intersect(Range("A1:A3"), Target.Dependents) If rng Is Nothing Then Set rng = Intersect(Range("A1:A3"), Target) On Error GoTo 0 If Not (rng Is Nothing) And Application.Sum(Range("A1:A3")) 30 Then MsgBox Application.Sum(Range("A1:A3")) End If End Sub -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: Are A3, B3 and C3 constants or formulas or a mixture of the two? -- HTH... Jim Thomlinson "Elaine" wrote: If A3, B3 and C3 in a sheet add up to over 30 I would like to automatically warn the user with a message box. Is it possible to put the amount these three cells add up to as well? If these cells add up to 30 or less then I don't want anything to happen. Any help would be appreciated. Thank you. --Elaine |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Opening an attachment of a message that has a message as attachmen | Excel Programming | |||
Add a Message Box | Excel Worksheet Functions | |||
changing the message in an error message | Excel Worksheet Functions | |||
VB message | Excel Programming | |||
Displaying a message in a message box without requiring user to click anything to proceed | Excel Programming |