Convert text values in a range to number values

Sometimes the number values imported from other sources into a worksheet may appear to be text. Execute the following statement to convert the text in a range to values.

'To convert numbers appeared to be text to number values
Range("B18:D18").Value = Range("B18:D18").Value

Note: Formulas in the range will also be converted to number and text values.

If you have used Excel to format a range as text (such as Range(“D18:D19”).NumberFormat = “@”), you must first clear the format before the conversion from text to number values.

'To convert text values in a range (which are formatted as text)
'to number values
Range("D18:D19").NumberFormat = ""
Range("D18:D19").Value = Range("D18:D19").Value