SOLVED

Converting text to numbers.

Copper Contributor

Good morning,

While getting data to excel, numbers were stored as text on multiple worksheets. Is there a way to convert text to numbers in all worksheets?

Szymeqpl__0-1697042175839.png

 

1 Reply
best response confirmed by Szymeqpl_ (Copper Contributor)
Solution

@Szymeqpl_ 

A macro:

Sub ConvertTextToNumbers()
    Dim wsh As Worksheet
    Application.ScreenUpdating = False
    For Each wsh In Worksheets
        With wsh.UsedRange
            .NumberFormat = "General"
            .Value = .Value
        End With
    Next wsh
    Application.ScreenUpdating = True
End Sub
1 best response

Accepted Solutions
best response confirmed by Szymeqpl_ (Copper Contributor)
Solution

@Szymeqpl_ 

A macro:

Sub ConvertTextToNumbers()
    Dim wsh As Worksheet
    Application.ScreenUpdating = False
    For Each wsh In Worksheets
        With wsh.UsedRange
            .NumberFormat = "General"
            .Value = .Value
        End With
    Next wsh
    Application.ScreenUpdating = True
End Sub

View solution in original post