Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Count values in Visible ROWS only

I am looking for a way to count the values rows that are visible. I have rows
A14:A83 with values. Rows A39:A83 may be hidden at time. When these rows are
hidden is there a way to count the values in rows A14:A38 only, even if rows
A39:A83 still contain values?


--
Randy Street
Rancho Cucamonga, CA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 277
Default Count values in Visible ROWS only

On Fri, 11 Dec 2009 15:53:01 -0800, Randy
wrote:

I am looking for a way to count the values rows that are visible. I have rows
A14:A83 with values. Rows A39:A83 may be hidden at time. When these rows are
hidden is there a way to count the values in rows A14:A38 only, even if rows
A39:A83 still contain values?



Hidden rows do not show up in a chart, so it *must* be possible.

When you look at a range, you should see values in the status bar at
the bottom of the Excel screen window. That status bar gives a few
statistics. Try looking at the bar, then hiding a row and see if the
value(s) change in the status bar.

OR, you could name the range above the hidden range, name the hidden
range, and name the rows below the hidden range, and perform summing
operations on the named ranges only, leaving out the hidden range by
simply not including it in the calculations.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Count values in Visible ROWS only

Give this statement a try...

VisibleValues = Range("A14:A83").SpecialCells(xlCellTypeConstants) . _
SpecialCells(xlCellTypeVisible).Count

Note: This code assumes that the values are constants and not values from
formulas.

--
Rick (MVP - Excel)


"Randy" wrote in message
...
I am looking for a way to count the values rows that are visible. I have
rows
A14:A83 with values. Rows A39:A83 may be hidden at time. When these rows
are
hidden is there a way to count the values in rows A14:A38 only, even if
rows
A39:A83 still contain values?


--
Randy Street
Rancho Cucamonga, CA


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Count values in Visible ROWS only

Hi Randy

The way I understand it you want to put a sum at the bottom of your
used range to sum all of the values which are not hidden. Microsoft
have a great custom function to do this, see below. Place in a normal
module.

Function Sum_Visible_Cells(Cells_To_Sum As Object)
Application.Volatile
For Each cell In Cells_To_Sum
If cell.Rows.Hidden = False Then
If cell.Columns.Hidden = False Then
total = total + cell.Value
End If
End If
Next
Sum_Visible_Cells = total
End Function

At the bottom of your used range use this formula.

=Sum_Visible_Cells(A14:A83)

If any cells are hidden inbetween these stated rows they will be
excluded from the count.

Take care

Marcus
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Count values in Visible ROWS only

Hi Randy

If you are looking for a worksheet funciton then try the below formula which
will count only the cells with values which are visible

=SUBTOTAL(102,A14:A83)

--
Jacob


"Randy" wrote:

I am looking for a way to count the values rows that are visible. I have rows
A14:A83 with values. Rows A39:A83 may be hidden at time. When these rows are
hidden is there a way to count the values in rows A14:A38 only, even if rows
A39:A83 still contain values?


--
Randy Street
Rancho Cucamonga, CA



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Count values in Visible ROWS only

Take a look at this:
http://www.ozgrid.com/Excel/excel-subtotal-function.htm


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Jacob Skaria" wrote:

Hi Randy

If you are looking for a worksheet funciton then try the below formula which
will count only the cells with values which are visible

=SUBTOTAL(102,A14:A83)

--
Jacob


"Randy" wrote:

I am looking for a way to count the values rows that are visible. I have rows
A14:A83 with values. Rows A39:A83 may be hidden at time. When these rows are
hidden is there a way to count the values in rows A14:A38 only, even if rows
A39:A83 still contain values?


--
Randy Street
Rancho Cucamonga, CA

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Count values in Visible ROWS only

On Sat, 12 Dec 2009 09:20:02 -0800, ryguy7272
wrote:

''Yes''

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
count identical values in 2 rows Piet Excel Worksheet Functions 7 April 7th 10 10:14 AM
Need a formula to count values in different rows ceri_m Excel Worksheet Functions 7 April 10th 08 11:14 AM
VBA (or Excel) crashes if Count of Visible Rows in Autofilter Range = 1 [email protected] Excel Programming 2 July 1st 07 03:08 AM
Function to display a count of visible cells/rows... doesn't Peter Rooney Excel Programming 7 May 16th 06 10:27 AM
count only the visible rows in a data table Eric[_27_] Excel Programming 11 August 22nd 05 01:12 AM


All times are GMT +1. The time now is 08:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"