I have two problems one is if i have empty cells it will not work and second that it does not calculate on tables when using sum column5
Thanks for any help provided
Thanks for any help provided
Code:
Public Shared Function TotalSumToNearest(Nums As Object) As Object
'----------------------------------------------------------------------
'** Demonstrates how to use an array(or range of multiple cells) as
' a function argument.
' Can be called with formulas such as =GetArray(A1:B5), GetArray(A1),
' or GetArray({1,2,3;4,5,6}).
'----------------------------------------------------------------------
Dim Sum As Double, v As Object
On Error GoTo Handler
If IsArray(Nums) Then
For Each v In Nums
'If TypeOf v.Getvalue() Is ExcelEmpty Then
'Else
Sum = Sum + CDbl(CInches(v) / 12)
'End If
Next
Else
Sum = CDbl(Nums)
End If
TotalSumToNearest = toNearest16th(Sum * 12)
Exit Function
Handler:
' GetArray = CVErr(2036) 'xlErrNum = 2036
End Function