Worksheetfunction help

  • Thread starter Thread starter Glen Mettler
  • Start date Start date
G

Glen Mettler

This gives me an error. What have I done wrong?
sRow=6
newval = Application.WorksheetFunction.Sum("ah" & sRow & ":DD" & sRow)

Glen
 
Glen
You can't just put in a range address like you can when you use the Sum
formula in a worksheet. You must state that this is a range. Something
like:
newval = Application.WorksheetFunction.Sum(Range("ah" & sRow & ":DD" &
sRow))
HTH Otto
 
Hi

To which worksheet you are referring to? Try MS Help example as muster:
....
sRow=6
myRange=Worksheets("Sheet1").Range("AH" & sRow & ":DD" & sRow)
newval=Application.WorksheetsFunction.Sum(myRange)


Arvi Laanemets
 
Interesting. The example I have from an Excel "Guru" book shows
"WorksheetFunction.Sum("A1:J4")

Thanks
Glen
 
That just proves that all self-certified "gurus" aren't <g>. It should say

WorksheetFunction.Sum(Range("A1:J4"))
 

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