I have columns of numbers that, for whatever reason, are formatted as text. This prevents me from using arithmetic functions such as the subtotal function. What is the best way to convert these "text numbers" to true numbers?
Here is a screenshot of the specific issue:
I've tried these snippets to no avail:
Columns(5).NumberFormat = "0"
and
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
解决方案
Use the below function (changing [E:E] to the appropriate range for your needs) to circumvent this issue:
[E:E].Select
With Selection
.NumberFormat = "General"
.Value = .Value
End With