View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
stanleydgromjr[_36_] stanleydgromjr[_36_] is offline
external usenet poster
 
Posts: 1
Default Sum Column in Array


Troubled User,

Try:

Adjust the range in the below code.



VBA Code:
--------------------




Option Explicit
Option Base 1
Sub SumArray()
Dim MyArray, a As Long, MyTotal As Double
MyTotal = 0
MyArray = *Range("A1:J10")*
For a = LBound(MyArray) To UBound(MyArray)
MyTotal = MyTotal + MyArray(a, *3*)
Next a
MsgBox "The sum of the third column is = " & Format(MyTotal, "#,##0.00")
End Sub


--------------------





Have a great day,
Stan


--
stanleydgromjr
------------------------------------------------------------------------
stanleydgromjr's Profile: 503
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=193109

http://www.thecodecage.com/forumz