Forum Discussion
AlexProfile
Mar 18, 2023Copper Contributor
Shortcut Key for Converting Value In Cell to Absolute Value
 In Office Home & Student 2021, I need an absolute value shortcut key(s) to change many possibly negative numbers in a spreadsheet to absolute values.  A general search has yielded shortcuts, but they...
HansVogelaar
Mar 18, 2023MVP
There is no built-in shortcut for this. You could create a macro in your personal macro workbook PERSONAL.XLSB and assign a custom keyboard shortcut to the macro.
Sub Convert2Absolute()
    Dim rng As Range
    Dim cel As Range
    Application.ScreenUpdating = False
    On Error Resume Next
    Set rng = Selection.SpecialCells(xlCellTypeConstants, xlNumbers)
    If Not rng Is Nothing Then
        For Each cel In rng
            cel.Value = Abs(cel.Value)
        Next cel
    End If
    Application.ScreenUpdating = True
End Sub
Select a range before running the macro. Cells with formulas and cells that don't contain a number will be ignored by the macro.