Application.WorksheetFunction error

A

Ayo

This line of code is not working. Any ideas?

Worksheets(1).Range("B22").Value =
Application.WorksheetFunction.Sum(Range("B17:B20"))
 
B

Bernie Deitrick

Are there any worksheetfunctions that are returning and Error value in B17:B20?

HTH,
Bernie
MS Excel MVP
 
A

Ayo

Thanks. I figured it out.
Worksheets(1).Range("B22").Value =
Application.WorksheetFunction.Sum(Worksheets(1).Range("B17:B20"))
I was missing the "Worksheets(1)." in the sum function.
 
A

Ayo

Thanks. I figured it out.
Worksheets(1).Range("B22").Value =
Application.WorksheetFunction.Sum(Worksheets(1).Range("B17:B20"))
I was missing the "Worksheets(1)." in the sum function.
 
Top