
Sub SommaParziale() Dim i As Variant Dim Somma As Long Dim Cella As Variant Somma = 0 For i = 2 To 1000 Cella = Cells(i, 25) If Cella <> "" Then Somma = Somma + Cella Else Cells(i, 25) = Somma GoTo fine End If Next i fine: End Sub |
Sub Funz_Somma()
Dim i As Variant
Dim FunzSomma As String
Dim Cella As Variant
For i = 2 To 1000
Cella = Cells(i, 25)
If Cella = "" Then
FunzSomma = "=SUM(R[-" & i - 2 & "]C:R[-1]C)"
Cells(i, 25).Select
ActiveCell.FormulaR1C1 = FunzSomma
GoTo fine
End If
Next i
fine:
End Sub |
