using the On Error Resume Next statement
Sub SelectionSqrt() Dim cell As range If TypeName(Selection) <> "Range" Then Exit Sub On Error Resume Next For Each cell In Selection cell.value = Sqr(cell.value) Next cell End Sub