5 pts.
 Excel VBA Count # of Cells within Max and Min in a Table
How do you write a VBA macro that count the numbers cell within a selected table that falls between a maximum and minimum number?

Software/Hardware used:
Excel VBA
ASKED: November 11, 2010  3:24 AM
UPDATED: November 25, 2010  7:25 PM

Answer Wiki:
You could use some code like this: <pre> With Application.WorksheetFunction Range("a1") = .CountIf(Range("a2:e5"), ">=0") - .CountIf(Range("a2:e5"), ">2") End With</pre> This example code would count the cells with values between 0 and 2 in range A2:E5, and will put thre result in cell A1.
Last Wiki Answer Submitted:  November 25, 2010  7:25 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _