Aug 31 2023 06:31 AM
Hi Everyone!
i hope you're all doing okay.
i guess my issue is there in the title waiting for an answer.
i want to use the cell function but couldn't find it or use through application.worksheetfunction
thanks
Aug 31 2023 07:26 AM
Let's say you want to calculate the sum of A2:A5 on Sheet1.
Dim s As Double
s = Application.WorksheetFunction.Sum(Worksheets("Sheet1").Range("A2:A5"))
Another way would be
Dim s As Double
s = Evaluate("SUM(Sheet1!A2:A5)")
or even
Dim s As Double
s = [SUM(A2:A5)]