change all numbers stored as text into numbers in one go.

PHOTO EMBED

Wed Sep 08 2021 06:01:09 GMT+0000 (Coordinated Universal Time)

Saved by @cnewnham #vba

Sub ConvertTextToNumber()

' A converter to change all numbers stored as text in to numbers in one go.

    Dim c As Range

    'IF YOU HAVE A SELECTION, THEN CONVERT ONLY THE SELECTION
    If Selection.Count > 1 Then
        
        For Each c In Selection
            If IsNumeric(c) And c <> "" Then c.Value = Val(c.Value)
        Next
    
    Else
    'IF NO SELECTION IS MADE, THEN CONVERT EVERY CELL WITHIN THE USED RANGE
        For Each c In ActiveSheet.UsedRange
            If IsNumeric(c) And c <> "" Then c.Value = Val(c.Value)
        Next
    
    
    End If


End Sub
content_copyCOPY