excel equation into vba

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

Excel equation into VBA

resolvedResolved · Low Priority · Version 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


 

Excel tip:

Shared Conditional Formatting

In a shared workbook, conditional formats applied before the workbook was shared will continue to work; however you cannot modify the existing conditional formats or apply new ones.

View all Excel hints and tips


Server loaded in 0.05 secs.