Search code examples
mathvbapowerpointsquare-root

How to do the square root in PowerPoint VBA?


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) & "."