VB and VBA Users Source Code: Sum the numerical values in an Array
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Sum the numerical values in an Array
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Thursday, October 19, 2000
Hits:
566
Category:
Visual Basic General
Article:
To sum the numerical values stored in an array using the following code: 'Purpose : Sums the numerical values contained in an array. 'Inputs : vaArray The array to sum 'Outputs : The sum of the values within vaArray 'Author : Andrew Baker 'Date : 25/03/2000 'Notes : Function ArraySum(avValues As Variant) As Double Dim vElement As Variant On Error Resume Next For Each vElement In avValues If IsNumeric(vElement) Then ArraySum = ArraySum + vElement End If Next On Error Goto 0 End Function
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder