Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use summation?


Hi There,

I am trying to write a macro that get the total (Sum of Column B) of a
column if row is infinite (meaning number of rows varied up to 5000
rows). Please see example data below.

A B
Invoice Summary Report
Account Total Amount Due
9 $24.94
22 $346.40
27 $153.34
42 $202.58
48 $31.24
53 $120.97
3671060 $3,484.06

Any help is very much appreciated. Thanks
Andrew


--
Akaplen
------------------------------------------------------------------------
Akaplen's Profile: http://www.excelforum.com/member.php...o&userid=24926
View this thread: http://www.excelforum.com/showthread...hreadid=384645

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use summation?


Can you just use the following?

sum(B:B)


--
jmagdziarz
------------------------------------------------------------------------
jmagdziarz's Profile: http://www.excelforum.com/member.php...o&userid=23108
View this thread: http://www.excelforum.com/showthread...hreadid=384645

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default How use summation?

Hi,


Assuming data starts in B2:

Sub InvTot()
Dim tot As Double
Set rng = Range("b2:b" & Cells(Rows.Count, "b").End(xlUp).Row)
tot = Application.Sum(rng)
End Sub

HTH

"Akaplen" wrote:


Hi There,

I am trying to write a macro that get the total (Sum of Column B) of a
column if row is infinite (meaning number of rows varied up to 5000
rows). Please see example data below.

A B
Invoice Summary Report
Account Total Amount Due
9 $24.94
22 $346.40
27 $153.34
42 $202.58
48 $31.24
53 $120.97
3671060 $3,484.06

Any help is very much appreciated. Thanks
Andrew


--
Akaplen
------------------------------------------------------------------------
Akaplen's Profile: http://www.excelforum.com/member.php...o&userid=24926
View this thread: http://www.excelforum.com/showthread...hreadid=384645


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
summation ExcelQuestion Excel Worksheet Functions 11 June 27th 07 02:28 AM
Summation from a to b jeblunk Excel Worksheet Functions 3 December 4th 05 02:14 PM
Summation Dan W. Excel Programming 0 June 29th 04 06:50 PM
VBA code to perform summation and product summation 21MSU[_2_] Excel Programming 4 May 17th 04 07:19 PM
Summation John Excel Programming 0 May 6th 04 07:01 PM


All times are GMT +1. The time now is 11:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"