| 
    
     |  | ▼だるま さんへ ありがとうございます。
 ファイル数が、1000近くあったのに、
 あっという間に思い通りのファイルの変更できました。
 vbaすばらしい!
 
 ただいま勉強中なのですが、
 6行目を削除というのは、作成して頂いた
 20行目に相当するのでしょうか?
 
 
 1Sub test()
 2  Dim myRange As Range
 3  Dim myCell As Range
 4  Dim myPath As String
 5  Dim N As Integer
 6  Dim D As String
 7  Dim A As Variant
 8
 9  Set myRange = Range("A1", Range("A65536").End(xlUp))
 10
 11  For Each myCell In myRange.Cells
 12    myPath = myCell.Value
 13    N = FreeFile
 14    Open myPath For Input As #N
 15    D = InputB(LOF(N), N)
 16    D = StrConv(D, vbUnicode)
 17    Close #N
 18
 19    A = Split(D, vbCrLf)
 20    A(5) = myCell.Offset(, 1).Value
 21    D = join(A, vbCrLf)
 22
 23    N = FreeFile
 24    Open myPath For Output As #N
 25    Print #N, D;
 26    Close #N
 27  Next
 28
 29  Set myCell = Nothing
 30  Set myRange = Nothing
 31  End Sub
 
 ありがとうございました。
 
 |  |