Sunday, April 21, 2019

Calculate the Cube Root


Calculate the Cube Root
To calculate cube root without applying a formula you can use this code. It will simply check all the selected cells and convert numbers to their cube root.
Sub getCubeRoot()
Dim rng As Range
Dimi As Integer
For Each rng In Selection
If WorksheetFunction.IsNumber(rng) Then
rng.Value = rng ^ (1 / 3)
Else
End If
Nextrng
End Sub

No comments:

Post a Comment