数字を文字列へ変換する

 

Sub test()

  ’ 数字を文字列へ変換


    Dim i As Long
    Dim myMax As Long


      ’ 最終行を取得
    myMax = Cells(Rows.Count, 1).End(xlUp).Row


    Application.Calculation = xlManual     ’画面表示を止める(高速化の為
    Application.ScreenUpdating = False    ’自動計算を止める(高速化の為


    For i = 2 To myMax
         Cells(i, 1) = "'" & Cells(i, 1)
    Next i

    Application.ScreenUpdating = True    ’画面表示を再開
    Application.Calculation = xlAutomatic   ’自動計算を再開

End Sub

 

実行結果

 

 

― ― ― ― ― ― ― ― ― ― → Excel VBA基礎入門もくじ へ戻る 

 

参考記事