I have a VBA Formula to calculate the sum of visible columns.
Function SumVisible(WorkRng As Range) As Double
Dim rng As Range
Dim total As Double
For Each rng In WorkRng
If rng.Rows.Hidden = False And rng.Columns.Hidden = False Then
total = total + rng.Value
End If
Next
SumVisible = total
End Function
This works fine for a range such as (A1:A3) but I want to hide specific columns and calculate the sum:
=SumVisible(I2,K2,M2,P2,S2,U2,AB2,Y2,AE2,AI2,AL2,AQ2,AS2,AV2)
How can I loop over individual cells and add their total if they are visible??