Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Modify to ignore the first row.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Modify to ignore the first row.


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Modify to ignore the first row.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Modify to ignore the first row.


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Modify to ignore the first row.

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
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
Modify a UDF please? Excel Helps Excel Worksheet Functions 2 January 23rd 08 09:40 AM
Modify a UDF please? Excel Helps Excel Worksheet Functions 0 January 23rd 08 12:10 AM
Modify a cell Vern Excel Discussion (Misc queries) 0 January 19th 07 08:51 PM
Modify this a bit Jay Excel Programming 5 April 22nd 05 06:43 PM
How would I modify the following? BruceJ[_2_] Excel Programming 3 October 29th 03 09:31 PM


All times are GMT +1. The time now is 11:28 PM.

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

About Us

"It's about Microsoft Excel"