hello
the aim of the following function is to calculate the average of a specific
number of columns containing only a required number format.
why is it not working
[VBA]
Function SumByFormat10(Rng As Range, Optional fmt As String = "0.00%")
Dim cell As Range, amt As Double, i As Integer
For Each cell In Rng
i = Rng.Columns.count
If cell.numberformat = fmt Then
If IsNumeric(cell.Value) Then
SumByFormat10 = (SumByFormat10 + cell.Value) / i
End If
End If
Next cell
End Function
[/VBA]