Sorry if this is a daft question...
To sum the values stored in an array, I currently use a For...Next loop. I can't help but think there must be a smarter and better way?
I am using Excel 2000. Thanks for any better suggestions!
Ade
Private Sub test()
Dim abc(0 To 2) As Integer
Dim x As Integer
abc(0) = 5
abc(1) = 10
abc(2) = 20
For n = 0 To 2
x = x + abc
Next n
MsgBox x
End Sub
To sum the values stored in an array, I currently use a For...Next loop. I can't help but think there must be a smarter and better way?
I am using Excel 2000. Thanks for any better suggestions!
Ade
Private Sub test()
Dim abc(0 To 2) As Integer
Dim x As Integer
abc(0) = 5
abc(1) = 10
abc(2) = 20
For n = 0 To 2
x = x + abc
Next n
MsgBox x
End Sub