Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Summing data in columns

Hi,

How can I get the sum of data contained in column "B", from
row 3 to last active row?

Thanks in advance

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default VBA - Summing data in columns

If this helps.....

1. Method 1 : Directly summing the entire range

Sub test()
Dim sum_b
sum_b = Application.WorksheetFunction.sum(Range("B3:B65536 "))
MsgBox sum_b
End Sub

2. Method 2: Defining the range first (From B3 to the last cell in
column b) and then summing the same

Sub test1()
Dim sum_b
Dim rng As Range
Set rng = Range("B3", Range("B65536").End(xlUp))
sum_b = Application.WorksheetFunction.sum(rng)
MsgBox sum_b
End Sub


ajliaks < wrote:

Hi,

How can I get the sum of data contained in column "B", from
row 3 to last active row?

Thanks in advance.


---
Message posted from http://www.ExcelForum.com/


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
summing two columns of different data Dick Scoppettone Excel Discussion (Misc queries) 4 May 25th 10 08:02 PM
summing data in multiple columns brad1824 Excel Discussion (Misc queries) 4 March 26th 10 01:52 AM
Summing data in columns ElGordo Excel Discussion (Misc queries) 3 November 27th 09 11:37 AM
summing columns if there is data Dave Excel Worksheet Functions 2 June 22nd 06 08:04 PM
summing data in several columns david72 Excel Discussion (Misc queries) 3 May 19th 06 07:49 AM


All times are GMT +1. The time now is 02:20 PM.

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"