How Do I Convert an Integer to a String in Excel VBA?

后端 未结 10 1788
遥遥无期
遥遥无期 2020-12-07 15:53

How do I convert the integer value \"45\" into the string value \"45\" in Excel VBA?

10条回答
  •  没有蜡笔的小新
    2020-12-07 16:44

    Another way to do it is to splice two parsed sections of the numerical value together:

    Cells(RowNum, ColumnNum).Value = Mid(varNumber,1,1) & Mid(varNumber,2,Len(varNumber))
    

    I have found better success with this than CStr() because CStr() doesn't seem to convert decimal numbers that came from variants in my experience.

提交回复
热议问题