1
如何將列中的單元格中的所有數字值轉換爲文本格式數字?我試過=TEXT(A2,"A2")
但它不幫我。將數字轉換爲文本格式的數字
如何將列中的單元格中的所有數字值轉換爲文本格式數字?我試過=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:選擇欄,分列,分隔,製表符,列數據格式文本。