Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() How do I do the following I want to sum the following range This is my guess, but it didn't work Dim x as currency x = Sum(Range("OutstandingBalance")) MsgBox x Thanks for any help Jos -- jhahe ----------------------------------------------------------------------- jhahes's Profile: http://www.excelforum.com/member.php...fo&userid=2359 View this thread: http://www.excelforum.com/showthread.php?threadid=38844 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Josh
try: Dim x As Currency x = WorksheetFunction.Sum(Range("OutstandingBalance")) MsgBox x Regards Trevor "jhahes" wrote in message ... How do I do the following I want to sum the following range This is my guess, but it didn't work Dim x as currency x = Sum(Range("OutstandingBalance")) MsgBox x Thanks for any help Josh -- jhahes ------------------------------------------------------------------------ jhahes's Profile: http://www.excelforum.com/member.php...o&userid=23596 View this thread: http://www.excelforum.com/showthread...hreadid=388442 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I assume you want the simplest method in which case you already have your
answer. Another approach would be to do a For...Each Cell in your range and then maintain a running total of each of the Cell.Values. I guess this method is oly useful if there is anything else you want to do with the numbers as well as simply SUM them. Cheers, Max "jhahes" wrote: How do I do the following I want to sum the following range This is my guess, but it didn't work Dim x as currency x = Sum(Range("OutstandingBalance")) MsgBox x Thanks for any help Josh -- jhahes ------------------------------------------------------------------------ jhahes's Profile: http://www.excelforum.com/member.php...o&userid=23596 View this thread: http://www.excelforum.com/showthread...hreadid=388442 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I tried the code and got a debug error as follows Method Range of Object Worksheet Failed Thanks Josh -- jhahes ------------------------------------------------------------------------ jhahes's Profile: http://www.excelforum.com/member.php...o&userid=23596 View this thread: http://www.excelforum.com/showthread...hreadid=388442 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Trevor's code should work...are you sure you have defined the range an are on the correct sheet -- Loss ----------------------------------------------------------------------- Losse's Profile: http://www.excelforum.com/member.php...fo&userid=2481 View this thread: http://www.excelforum.com/showthread.php?threadid=38844 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Losse
not much to go wrong really ;-) The sheet shouldn't matter as the range is defined. If the range name isn't defined (a typo maybe), I get a slightly different error message: Method 'Range' of object '_Global' failed Perhaps it depends on the version of Excel ? Regards Trevor "Losse" wrote in message ... Trevor's code should work...are you sure you have defined the range and are on the correct sheet? -- Losse ------------------------------------------------------------------------ Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813 View this thread: http://www.excelforum.com/showthread...hreadid=388442 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I enter formula sum(range+range)*0.15 sumif(range=3) | Excel Discussion (Misc queries) | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
Range.Find returns cell outside of range when range set to single cell | Excel Programming | |||
how to? set my range= my UDF argument (range vs. value in range) [advanced?] | Excel Programming |