ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheetfunction help (https://www.excelbanter.com/excel-programming/322759-worksheetfunction-help.html)

Glen Mettler[_4_]

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

Glen



Otto Moehrbach

Worksheetfunction help
 
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
"Glen Mettler" wrote in message
...
This gives me an error. What have I done wrong?
sRow=6
newval = Application.WorksheetFunction.Sum("ah" & sRow & ":DD" & sRow)

Glen





Arvi Laanemets

Worksheetfunction help
 
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


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

Glen





Glen Mettler[_4_]

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

Thanks
Glen

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

Glen





Myrna Larson

Worksheetfunction help
 
That just proves that all self-certified "gurus" aren't <g. It should say

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

On Wed, 9 Feb 2005 14:27:41 -0600, "Glen Mettler"
wrote:

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

Thanks
Glen

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

Glen






All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com