# Sqr VBA function – How to calculate square root

## 1. Sqr VBA function – Description

The Sqr VBA function returns the square root of the argument with the Double data type. With this function we can calculate the root of the second degree. To calculate the root of a greater degree than the second, i.e. the root of the third or fourth degree , we will not do it using this function. We can do this by taking a number to the power of (1/3) or (1/4).

## 2. 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

## 3. 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 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)```