Function CountIfMZ(champrech As Range, valCherchée)
Application.Volatile
temp = 0
For i = 1 To champrech.Areas.Count
For j = 1 To champrech.Areas(i).Count
If valCherchée = champrech.Areas(i)(j) Then
temp = temp + 1
End If
Next j
Next i
CountIfMZ = temp
End Function
The ranges are absolute and will not change if the range changes. For
example, if you drag the range F15:J15 to G2:K2 the formula won't
automatically change to reflect the new range location. It'll still
reference F15:J15. Same thing with new row/column insertions.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.