[RESOLVED] Sum of 2 rows (Used Range), check negative (VBA)
Not sure how to describe this but I'll give it a go:
If have 3 Columns: A, B C
Example:
* A B C
1 5 4
2 7 1
3 3 7
4 2 1
Now I want to do a sum of Col.A MINUS Col.B >> Answer in Col.C >> If Col.C is negative, then color.
When using my example, Row 3 should be colored.
I hope someone understands what I'm trying to do.
Thanks in advance.
Re: Sum of 2 rows (Used Range), check negative (VBA)
your description and example do not seem to match
else i completely misunderstand what you want
AB and C are normally considered to be columns rather than rows
Re: Sum of 2 rows (Used Range), check negative (VBA)
Yes, sorry. I meant to say: Columns, instead of rows. You are correct. I changed it.
Re: Sum of 2 rows (Used Range), check negative (VBA)
Quote:
Row 3 should be colored.
you can use conditional formatting for this, but why (in your example) row 3?
i can not see any relation to the values of columns a and b, in column C
or is column c some other value, and only in the totals row is it relative to columns a and b?
Re: Sum of 2 rows (Used Range), check negative (VBA)
The value of C3 will be -4. (C3= A3-B3) Since it's negative I want it to be colored.
Forget Column C
Let me try to explain it better.
There are 2 columns: ("D: D") & ("F:F")
I want to color the row when D1..etc NIMUS F1..etc is negative.
I need to do this for the UsedRange, since the range is never the same.
Hopefully this explanation is better.
Thanks in advance.
Re: Sum of 2 rows (Used Range), check negative (VBA)
Quote:
I need to do this for the UsedRange, since the range is never the same.
look into using conditional formatting for the entire sheet
Re: Sum of 2 rows (Used Range), check negative (VBA)