Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Returning Range Total in VBA

Excel2k

Hi

I've set a range in vba (ActiveCell.Range("A1:E1")) and
I'd like to find out the value of this range (The
equivilant of =Sum("A1":"E1") CAn anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Returning Range Total in VBA

Hi
try
dim rng
set rng = range("A1:E1")
msgbox applicatuion.worksheetfunction.sum(rng)

--
Regards
Frank Kabel
Frankfurt, Germany


JimPNicholls wrote:
Excel2k

Hi

I've set a range in vba (ActiveCell.Range("A1:E1")) and
I'd like to find out the value of this range (The
equivilant of =Sum("A1":"E1") CAn anyone help?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Returning Range Total in VBA

One way:

Dim dSum As Double
dSum = Application.Sum(ActiveCell.Resize(1, 5))

In article ,
"JimPNicholls" wrote:

Excel2k

Hi

I've set a range in vba (ActiveCell.Range("A1:E1")) and
I'd like to find out the value of this range (The
equivilant of =Sum("A1":"E1") CAn anyone help?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Returning Range Total in VBA

Hi,

Sub TEST_1()
MsgBox Application.Sum([A1:E1])
End Sub


Sub TEST_2()
MsgBox [SUM(A1:E1)]
End Sub



--
Regards,
Soo Cheon Jheong
_ _
^ąŻ^
--


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
Excel returning an incorrect total ETC Excel Discussion (Misc queries) 2 February 24th 10 02:44 PM
Function returning the total of two adjacent columns CAT Excel Worksheet Functions 3 September 29th 08 06:26 PM
Returning a range using IF Alan Excel Worksheet Functions 3 September 12th 07 11:08 PM
Summing related cell values and returning total to summary gt_initial Excel Discussion (Misc queries) 2 March 7th 07 05:42 PM
MY VLOOKUP IS RETURNING N/A AND THEREFORE MY TOTAL SUM AT THE BOT. Martin Excel Discussion (Misc queries) 2 December 13th 04 11:21 AM


All times are GMT +1. The time now is 03:10 PM.

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

About Us

"It's about Microsoft Excel"