View Single Post
  #39  
Old May 4th, 2006, 09:38 PM posted to microsoft.public.excel.misc
external usenet poster
 
Posts: n/a
Default Summing non hidden values in a range

http://cjoint.com/?fewLLijimL

With this instruction, worksheet is calculate:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
calculate
End Sub

Function sumVisibles(champ As Range)
Application.Volatile
t = 0
For Each c In champ
If c.EntireColumn.Hidden = False Then t = t + c.Value
Next c
sumVisibles = t
End Function

Cordialy JB