Returning Range Total in VBA

  • Thread starter Thread starter JimPNicholls
  • Start date Start date
J

JimPNicholls

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?
 
Hi
try
dim rng
set rng = range("A1:E1")
msgbox applicatuion.worksheetfunction.sum(rng)
 
One way:

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

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


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



--
Regards,
Soo Cheon Jheong
_ _
^¢¯^
--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top