2015-09-03 140 views

回答

0

這是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 
0

沒有VBA:選擇欄,分列,分隔,製表符,列數據格式文本。