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