# Variable range in vba function formula

Closed
a_elgazar Posts 5 Registration date Thursday October 27, 2016 Status Member Last seen November 5, 2016 - Nov 5, 2016 at 08:25 AM
yg_be Posts 22692 Registration date Sunday June 8, 2008 Status Contributor Last seen April 16, 2024 - Dec 15, 2016 at 05:44 PM
Hello,
If i want to do this formula

((1/c1)^2+(1/c2)^2 .............................. + (1/c)^2 )^(-0.5)

for variable range by ( vba function) or excel formula

note:

i can use this way but i need to use variable range

Public Function Add(number1 As Double, number2 As Double)
Add = (1 / (number1) ^ 2 + 1 / (number2) ^ 2) ^ (-0.5)
End Function

Related:

## 1 response

yg_be Posts 22692 Registration date Sunday June 8, 2008 Status Contributor Last seen April 16, 2024 5
Nov 6, 2016 at 08:53 AM
How is the range determined?
Are the value present in adjacent cells in a sheet?
Are you prepared to add formulas into that sheet?
yg_be Posts 22692 Registration date Sunday June 8, 2008 Status Contributor Last seen April 16, 2024 5
Dec 15, 2016 at 05:44 PM
Did you get the answer you expected?