1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Public Sub test()
Dim i As Long
Dim S_sing As Single
Dim S_doub As Double
Dim S_curr As Currency
Dim S_deci As Variant 'Variant/Decimal
For i = 2 To 271
S_sing = S_sing + Cells(i, 2)
S_doub = S_doub + Cells(i, 2)
S_curr = S_curr + Cells(1, 2)
S_deci = S_deci + CDec(Cells(1, 2))
Next i
Debug.Print "S_sing = "; S_sing
Debug.Print "S_doub = "; S_doub
Debug.Print "S_curr = "; S_curr
Debug.Print "S_deci = "; S_deci
End Sub
'S_sing = -0,185
'S_doub = 4,07453626394272E-10
'S_curr = 0
'S_deci = 0 |