'Sub()
Sub calcola()
Dim AZ As Range
Dim valore As Double
valore = 0
Set AZ = Range("A1:A5")
For Each a_z In AZ
valore = valore + Application.Evaluate(a_z.Formula)
Next
Set AZ = Nothing
Range("A6") = valore
End Sub
'Funzione da utilizzare come somma
'utilizzo =Somma_Range("A1:A5")
Public Function Somma_Range(TCelle As Range)
Dim celle As Range
Dim Totale As Double
Dim cella As Variant
Set celle = TCelle
For Each cella In celle
Totale = Totale + Application.Evaluate(cella.Formula)
Next
Set celle = Nothing
Somma_Range = Totale
End Function
|