change to number in vba code example
Example 1: excel vba convert string to a number if string is a number
MsgBox Val(str)
'If string does not start with a numeric text value, Val() returns a zero.
Example 2: vba text to general
'VBA ONLY
Sub CleanTextToGeneral()
With Selection
.NumberFormat = "General"
.Value = .Value
End With
End Sub