Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

excel equation into vba

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Excel equation into VBA

Excel equation into VBA

ResolvedVersion 2016

Tim has attended:
Excel VBA Intermediate course

Excel equation into VBA

Trying to create a VBA function to replicate the excel function =SQRT(SUMSQ(A:A)) Where A:A is any selected range of numbers
current Function code is below:

Function QSUM(myRange As Range, Critiria As Double)

QSUM = Sqr(Application.WorksheetFunction.SumSq(myRange))

End Function

At present value error returned.

RE: Excel equation into VBA

Hi Tim,

Thank you for the forum question and the nice feedback.

I think I must have confused you with the Countif example and I didn't see it when I looked at it during the course.

Try:

Function QSUM(myRange As Range)

QSUM = Sqr(Application.WorksheetFunction.SumSq(myRange))

End Function


Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Excel equation into VBA

Thanks Jens

 

Training courses

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Switch between workbooks ni EXCEL.

use Alt-TAB to switch between workbooks.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.