Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening an attachment of a message that has a message as attachmen vetron Excel Programming 0 January 30th 06 06:17 PM
Add a Message Box Anthony Excel Worksheet Functions 2 February 25th 05 03:29 AM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
VB message JT[_2_] Excel Programming 0 September 22nd 04 02:27 PM
Displaying a message in a message box without requiring user to click anything to proceed Android[_2_] Excel Programming 2 June 25th 04 06:44 PM


All times are GMT +1. The time now is 11:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"