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? |
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? |
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? |
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 _ _ ^вп^ -- |
All times are GMT +1. The time now is 09:57 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com