将数字转换为文本格式的数字
如何将列中单元格中的所有数字值转换为文本格式数字?
我试过=TEXT(A2,"A2")
但它不帮助我。
这是VBA,因为那是在你的标签。
循环更改所需列的行。
Dim ws1 As Excel.Worksheet Dim strValue As String Set ws1 = ActiveWorkbook.Sheets("Sheet3") Dim lRow As Long lRow = 1 ws1.Activate 'Loop through and record what is in the columns Do While lRow <= ws1.UsedRange.Rows.count 'Make sure we have a value to read into our string If ws1.Range("F" & lRow).Value <> "" Then 'Get the number as a string strValue = str(Trim(ws1.Range("F" & lRow).Value)) 'Format the cell as text ws1.Range("F" & lRow).NumberFormat = "@" 'Write the string value back to the cell ws1.Range("F" & lRow).Value = strValue End If lRow = lRow + 1 Loop
没有VBA:select您的列,文本到列,分隔符,标签,列数据格式文本。