Reputation: 141
I would like to create a code in VBA which does the same function as those:
{=MIN(IF(rng1=criteria1,IF(rng2=criteria2,values)))}
and
{=MAX(IF(rng1=criteria1,IF(rng2=criteria2,values)))}
I have a lot of those function calls in document and it works really slow so I want to replace that...
Basically the result is to find a criteria in row and then in other range find minimum(higher than 0) and maximum value.
Do you have any ideas? Thank you in advance.
Upvotes: 0
Views: 6941
Reputation: 907
Sheets("Name").Range("A1").FormulaArray = "=MIN(IF(sheet1!C:C=""A"",sheet!E:E))"
where column C is the range with the criterion and column E contains the values where you would like to extract the min.
Upvotes: 1