aworthey
06-06-2016, 10:45 AM
Hello,
Is there a way of easily adapting this code to average visible cells horizontally? Thanks!
Function Sum_Visible_Cells(Cells_To_Sum As Object)
Dim cell As Object
Dim Total As Double
Application.Volatile
For Each cell In Cells_To_Sum
If (cell.Rows.Hidden = False) And (cell.Columns.Hidden = False) Then
Total = Total + cell.Value
End If
Next
Sum_Visible_Cells = Total
End Function
Is there a way of easily adapting this code to average visible cells horizontally? Thanks!
Function Sum_Visible_Cells(Cells_To_Sum As Object)
Dim cell As Object
Dim Total As Double
Application.Volatile
For Each cell In Cells_To_Sum
If (cell.Rows.Hidden = False) And (cell.Columns.Hidden = False) Then
Total = Total + cell.Value
End If
Next
Sum_Visible_Cells = Total
End Function