Thread: SUM in VBA
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default SUM in VBA



i = Application.Sum(Worksheets("Sheet1").Range("A1:A13 "))

"Gary''s Student" wrote:

In the worksheet:
=SUM(Sheet1!A1:Sheet1!A13)
works just fine, giving the sum of cells.
In VBA:
Dim i As Variant
i = Application.SUM(Sheet1!A1:Sheet1!A13) just give a compile error.

Why?
--
Gary's Student