Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() That doesn't address the CountIF part of the question. Cordially, Chip Pearson Microsoft MVP 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com [email on web site] On Mon, 21 Dec 2009 18:50:37 -0500, "JLGWhiz" wrote: Excel does not provide that function, but John Walkenbach does. Put this in your public code module: Function COUNTVISIBLE(rng) ' Counts visible cells Dim CellCount As Long Dim cell As Range Application.Volatile CellCount = 0 Set rng = Intersect(rng.Parent.UsedRange, rng) For Each cell In rng If Not IsEmpty(cell) Then If Not cell.EntireRow.Hidden And _ Not cell.EntireColumn.Hidden Then _ CellCount = CellCount + 1 End If Next cell COUNTVISIBLE = CellCount End Function If you want only visible cells for C10:C250 then =COUNTVISIBLE(C10:C250) "Doug" wrote in message ... =COUNTIF($CF3:$CF1000,"<2000") How can I get this to return the total count excluding the hidden cells in the range? Right now it shows all. -- Thank you! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yep, Chip, I overlooked that. I started to write some code for it but see
that you already did. "Chip Pearson" wrote in message ... That doesn't address the CountIF part of the question. Cordially, Chip Pearson Microsoft MVP 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com [email on web site] On Mon, 21 Dec 2009 18:50:37 -0500, "JLGWhiz" wrote: Excel does not provide that function, but John Walkenbach does. Put this in your public code module: Function COUNTVISIBLE(rng) ' Counts visible cells Dim CellCount As Long Dim cell As Range Application.Volatile CellCount = 0 Set rng = Intersect(rng.Parent.UsedRange, rng) For Each cell In rng If Not IsEmpty(cell) Then If Not cell.EntireRow.Hidden And _ Not cell.EntireColumn.Hidden Then _ CellCount = CellCount + 1 End If Next cell COUNTVISIBLE = CellCount End Function If you want only visible cells for C10:C250 then =COUNTVISIBLE(C10:C250) "Doug" wrote in message ... =COUNTIF($CF3:$CF1000,"<2000") How can I get this to return the total count excluding the hidden cells in the range? Right now it shows all. -- Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I use a countif function according to two other countif fu. | Excel Worksheet Functions | |||
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") | Excel Discussion (Misc queries) | |||
COUNTIF or not to COUNTIF on a range in another sheet | Excel Worksheet Functions | |||
Countif | Excel Discussion (Misc queries) | |||
COUNTIF in one colum then COUNTIF in another...??? | Excel Worksheet Functions |