VB evaluate a value in a table's column and display msgbox

A

AusTexRich

I've reviewed all of the questions and responses, but, didn't find anything
similar to what I needed. My table has one column which adds values,
positive and negative, from another column or a running total, if you will.
When a specific value, plus or minus, is reached I want a corresponding
message to display, i.e, when the value of the running total >= 40 is one
message and when the running total <= -60 is the other. Can help?
 
D

Duke Carey

A little more info would facilitate a more concise response

Where do the numbers in the 'other' column come from? Is somebody entering
them manually?
 
B

Bob Phillips

A shot at what you might mean.

In B1,

=IF(SUM($B$1:B1)>=40,"one message",IF(SUM($B$1:B1)<=-60,"another
message",""))
 
L

Loris

You can certainly accomplish it with a nested IF statement along these lines:
ASSUME THE TOTAL OF COLUMN WITH YOUR VALUES IS IN CELL C1,
=IF(C1>=40,"MAXIMUM EXCEEDED",IF(C1<=-60,"MINIMUM EXCEEDED",""))
See if this works for you.
 
A

AusTexRich

Sorry.
Column G looks up values from a table based on numbers entered in column D
and returns a plus or minus value (to col G). Column H sums that number plus
the number in the cell above in the same column (H), hence the running total.
A message should display based on the value at that time in col H.

Better?
 
A

AusTexRich

For clarity here's the model

D - G - H
1
2
3 A 5 5
4 B 10 15
5 C 5 20
6 D 21 41 Message displayed when value >= 40
7 E -102 -61 Message displayed when value <= -60

Column D is an number that's entered
Column G looks up the value for the number in Col D
Column H keeps the running total



AusTexRich
 
A

AusTexRich

That'll work.

Many thanks
--
AusTexRich


Loris said:
You can certainly accomplish it with a nested IF statement along these lines:
ASSUME THE TOTAL OF COLUMN WITH YOUR VALUES IS IN CELL C1,
=IF(C1>=40,"MAXIMUM EXCEEDED",IF(C1<=-60,"MINIMUM EXCEEDED",""))
See if this works for you.
 
A

AusTexRich

That'll work. I was trying to get a Vba message box, but, this is one way.
Thanks
 
Top