First of all Aladdin told me to ask you. Because the solution is by the VBA he said.
I hide them. I have a big file and every month i update it. There are a lot of empty cells so i hide them. But next month they can have numbers because they are linked. So every time i have to unhide and check if they have numbers or not. I need a function that only get sum of the visible cells not the unhided ones. As the function in status bar.
If i filter the empty cells, i can have the sum with SUBTOTAL function by excluding the hided cells . But ý have to hide the rows manually so i can not use the subtotal function.
This UDF may help you
Function SumVisibleCells(SumRg As Range)
Application.Volatile
Dim sCell As Range
Dim s
For Each sCell In SumRg
If sCell.EntireRow.Hidden = False Then
s = s + sCell
End If
Next
SumVisibleCells = s
End Function
Ivan
Gokhan has indeed informed me about his problem in an e-mail in my native tongue, whence this continuation.
I wonder if you could help him to hide/unhide automatically thru VBA, something that is like what 'faster' did at
26805.html
integrated with your UDF?
Aladin
...why doesn't Gokhan just use AutoFilter? The
same logic needed to hide/unhide via VBA could be
incorporated into a formula whose results are
then filtered. If Gokhan doesn't want to see
the column containing this formula it can be
hidden. 26805.html integrated with your UDF? : This UDF may help you : Function SumVisibleCells(SumRg As Range) : Application.Volatile : Dim sCell As Range : Dim s : For Each sCell In SumRg : If sCell.EntireRow.Hidden = False Then : s = s + sCell : End If : Next : SumVisibleCells = s : End Function
Re: I don't understand...
same logic needed to hide/unhide via VBA could be incorporated into a formula whose results are then filtered. If Gokhan doesn't want to see the column containing this formula it can be hidden.
Neither do I. My suggestion has been to make the process he describes fully automatic, triggered by changes in the range where he got his numbers. : Gokhan has indeed informed me about his problem in an e-mail in my native tongue, whence this continuation. : I wonder if you could help him to hide/unhide automatically thru VBA, something that is like what 'faster' did at : 26805.html : integrated with your UDF? : Aladin