View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
xlmate xlmate is offline
external usenet poster
 
Posts: 144
Default Subtoal excluding hidden columns

If you are looking to sum across the columns, the only solution I know of is
a macro, try this UDF:

Function SUMVIS(rng)
Dim CellSum As Long
Dim Cell As Range
Application.Volatile
CellSum = 0
Set rng = Intersect(rng.Parent.UsedRange, rng)
For Each Cell In rng
If IsNumeric(Cell) Then
If Not Cell.EntireRow.Hidden And _
Not Cell.EntireColumn.Hidden Then _
CellSum = CellSum + Cell
End If
Next Cell
SUMVIS = CellSum
End Function

Enter : =SUMVIS(..your columns...)


Does this do what you want?
Pls click Yes if this have help you.

cheers,

"xlmate" wrote:

I have tried the Subtotal function with a hidden column
and it work for me.

check the column headings which you want to apply subtotals to
under Add subtotal to in the Subtotal dialog box

Is this waht you are after?
Pls click Yes if this help

cheers

"Trevor" wrote:

Does anyone how I can sum many columns within a row but exclude hidden colums
from the calculation?
The subtotal(109,"range") works for rows but not columns

Thank you!