How to do the square root in PowerPoint VBA?
-
19-09-2019 - |
Question
Here is some math code that adds A to B:
Sub math()
A = 23
B = 2
ABSumTotal = A + B
strMsg = "The answer is " & "$" & ABSumTotal & "."
MsgBox strMsg
End Sub
But how can I calculate a square root of ABSumTotal? Is it possible in PowerPoint VBA?
Solution
Use: Sqr()
strMsg = "The answer is " & "$" & Sqr(ABSumTotal) & "."
OTHER TIPS
Have you tried the function Sqr?
See: http://msdn.microsoft.com/en-us/library/h2h9y284%28VS.85%29.aspx
You can use use ^
to compute X^(1/2)
Edit: added parenthesis
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow