Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
COUNTIF criteria in VBA
What vba function can I use that checks criteria much like SUMIF o COUNTIF uses? In other words, say you want to write COUNTIF that onl includes visible cells... Public Function CountVIf(rng As range, criteria As String) Dim cell As range, cmd As String For Each cell In rng If cell.RowHeight < 0 And cell.ColumnWidth < 0 Then cmd = "COUNTIF(" & cell.Address & ",""" & criteria & """)" CountVIf = CountVIf + Evaluate(cmd) End If Next cell End Function How can I do this without having to rely on Evaluate("COUNTIF...."? Thanks -- whitehurs ----------------------------------------------------------------------- whitehurst's Profile: http://www.excelforum.com/member.php...fo&userid=3454 View this thread: http://www.excelforum.com/showthread.php?threadid=55035 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
NEED TO COUNTIF WITH TWO CRITERIA | Excel Worksheet Functions | |||
COUNTIF criteria | Excel Worksheet Functions | |||
Countif with more than one criteria | Excel Discussion (Misc queries) | |||
Countif using format criteria not number criteria? | Excel Worksheet Functions | |||
Countif using format criteria....not number criteria? | Excel Worksheet Functions |