worksheetfunction.sum error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Private sub cmdUpdate_Click()

*other code*
Range ("E44") = Application.WorksheetFunction.Sum("F31:F38")
* other code*

End Sub

This line gives me a run-time error '1004' - Unable to get the Sum property
of the WorksheetFunction class.

I have no idea what this means or how to fix it.

If anyone could help, it is much appreciated.

Thanks
 
You need a range

Range ("E44") = Application.worksheetfunction.Sum(range("F31:F38"))
 
You need to supply the SUM function a range, not a string:

Range("E44") = Application.WorksheetFunction.Sum(Range("F31:F38"))
 
Application.worksheetfunction.Sum(range() ) worked for me. Thanks.

I had WorksheetFunction.Sum( )
 
Last edited:

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

Similar Threads

VLookup in VBA Help Needed 9
VBA userform Vlookup Excel 1
SumIF error 1004 4
VLookup error 4
Error Upon Opening Excel 2
Vlookup property missing 3
Vlookup in VBA 4
VBA to SUM a row of numbers 3

Back
Top