View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Putting contents of an Array into a Cell

Dim myArr As Variant
myArr = Array(1, 3, 5)
MsgBox Application.Sum(myArr)

John Pierce wrote:

Thanks Dave, I am using 2003. One more question.
Suppose that the elements of MyArray were actuall
values rather than labels. Is there a straightforward way,
similar to Join, to SUM all the elements, in this case,
58, and put that total value in a cell? Or would it take
a loop of some kind? Thanks again.


--

Dave Peterson