# Sqr VBA function – How to calculate square root

## Sqr VBA function – Description

The Sqr VBA function returns the square root of the argument in the Double data type. With this function you can calculate the root of the second square degree. To calculate the root of a greater degree than the second, i.e. the root of the third or fourth degree, you can’t use this function. You can do this operation by taking a number to the power of (1/3) or (1/4).

## VBA Sqr Function – Syntax

```'officeinside.org
Sqr (Number As Double) As Double```

Number : A number with the Double data type.

Function return : Double / Numeric value

## VBA Sqr function – Example

How to use Sqr function in VBA Excel? Below are examples of using the Sqr function in the VisualBasic Editor.

Example 1: Using the Sqr function – extracting the square root. The result will appear in the MsgBox window

```'officeinside.org
Dim DblNumber As Double
DblNumber = 100
MsgBox Sqr (DblNumber)```

Example 2: Result in a worksheet cell. Extracting the VBA root

```'officeinside.org
Dim DblNumber As Double
DblNumber = 100
Range ("A1") = Sqr (DblNumber)```