Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello from Steved
How can I modify the below to ignore the first row please. Sub AddSum() r = Range("$D$1000").End(xlUp) MsgBox "SUM:" & Application.WorksheetFunction.Sum(Range("D:G")) End Sub Thankyou. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Steved, Sub AddSum() r = Range("$D$1000").End(xlUp).Row MsgBox "SUM:" & Application.WorksheetFunction.Sum(Range("D2:G"& r)) End Sub Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=488422 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Leith from Steved.
Excellent Thankyou. "Leith Ross" wrote: Hello Steved, Sub AddSum() r = Range("$D$1000").End(xlUp).Row MsgBox "SUM:" & Application.WorksheetFunction.Sum(Range("D2:G"& r)) End Sub Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=488422 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This will work if you don't have any cells that don't have data in th D,E,F,G columns. End(xlDown) finds the last cell with data in it. Sub AddSum1() r = Range("$D$1000").End(xlUp) Range(Range("D2"), Range("D2").End(xlDown)).Name = "Begin" Range(Range("G2"), Range("G2").End(xlDown)).Name = "End" MsgBox "SUM:" _ & Application.WorksheetFunction.Sum(Range("Begin:End ")) End Su -- DataCollecto ----------------------------------------------------------------------- DataCollector's Profile: http://www.hightechtalks.com/m36 View this thread: http://www.hightechtalks.com/t229520 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello DataCollector from Steved
Thankyou. "DataCollector" wrote: This will work if you don't have any cells that don't have data in the D,E,F,G columns. End(xlDown) finds the last cell with data in it. Sub AddSum1() r = Range("$D$1000").End(xlUp) Range(Range("D2"), Range("D2").End(xlDown)).Name = "Begin" Range(Range("G2"), Range("G2").End(xlDown)).Name = "End" MsgBox "SUM:" _ & Application.WorksheetFunction.Sum(Range("Begin:End ")) End Sub -- DataCollector ------------------------------------------------------------------------ DataCollector's Profile: http://www.hightechtalks.com/m368 View this thread: http://www.hightechtalks.com/t2295206 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Modify a UDF please? | Excel Worksheet Functions | |||
Modify a UDF please? | Excel Worksheet Functions | |||
Modify a cell | Excel Discussion (Misc queries) | |||
Modify this a bit | Excel Programming | |||
How would I modify the following? | Excel Programming |