Convert numbers stored as text to numbers?

前端 未结 4 1273
既然无缘
既然无缘 2021-01-15 22:29

How can I convert numbers stored as text to numbers?

I have tried setting:

ActiveSheet.Range(\"H154\").NumberFormat = \"General\"

B

4条回答
  •  再見小時候
    2021-01-15 23:05

    if you want to convert a selection (even with text in it!), you can use the code by firefiend (http://www.ozgrid.com/forum/showthread.php?t=64027&p=331498#post331498)

    I think the magic is in .Value = .Value

    vba Sub macro() Range("F:F").Select 'specify the range which suits your purpose With Selection .NumberFormat = "General" .Value = .Value End With End Sub

提交回复
热议问题