Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I'm struggling with a variant of sumif.
Below a classic example:
Now, suppose the criteria is not univocal.
I mean: the criteria is not in C1, but has to correspond in one of the value included in a range.
For example, in the range rng
How can I figure this out?
Thank's in advance.
I'm struggling with a variant of sumif.
Below a classic example:
Code:
Result = Application.WorksheetFunction.SumIf(Range("A:A"), Range("C1").Value, Range("B:B"))
Now, suppose the criteria is not univocal.
I mean: the criteria is not in C1, but has to correspond in one of the value included in a range.
For example, in the range rng
Code:
dim lr as long
lr = Cells(Rows.Count, "C").End(xlUp).Row
set rng as range
rng = Range("C2:C" & lr)
How can I figure this out?
Thank's in advance.
Last edited: