S
Simon Clark
Hi guys.
I would like to create a sum in a column, but the sum has to be based
on another cell value.
So... if i have values in column A (already calculations based on
something else) i want to make a sum of those values where the
adjacent cell equals a certain value. This occurance can happen for
more than 100 rows, so i am guessing i need some VBA here.
E.g.
----
A B
11 Yes
12 no
12 no1
23 no
34 no2
53 Yes
83 no
1 no
''Where B equals "Yes" sum in column A until the next Occurance of
"Yes".
''Where there's a value in column A with Yes..ignore value
''Therefore in Cell A1,
''i should have a total of... 81
''(A2+A3+A4+A5)
''and in cell A6 i should have 84 (A7+A8)
So the formula will continue for each time there's a Yes in column
"B".
Can this be done in VBA?
Thanks...
Sim
I would like to create a sum in a column, but the sum has to be based
on another cell value.
So... if i have values in column A (already calculations based on
something else) i want to make a sum of those values where the
adjacent cell equals a certain value. This occurance can happen for
more than 100 rows, so i am guessing i need some VBA here.
E.g.
----
A B
11 Yes
12 no
12 no1
23 no
34 no2
53 Yes
83 no
1 no
''Where B equals "Yes" sum in column A until the next Occurance of
"Yes".
''Where there's a value in column A with Yes..ignore value
''Therefore in Cell A1,
''i should have a total of... 81
''(A2+A3+A4+A5)
''and in cell A6 i should have 84 (A7+A8)
So the formula will continue for each time there's a Yes in column
"B".
Can this be done in VBA?
Thanks...
Sim