Option Explicit

Sub Replace_File_Click()
    
    '宣言
    Dim path As String
    Dim rowPath As Integer
    Dim wordBef As String
    Dim wordAft As String
    
    '初期設定
    rowPath = 3

    Do While Cells(rowPath, 2) <> ""
        path = Cells(rowPath, 2)
        wordBef = Cells(rowPath, 3)
        wordAft = Cells(rowPath, 4)
        Call Replace_File(path, wordBef, wordAft)
        rowPath = rowPath + 1
    Loop
    
End Sub

'指定したファイル(pathで指定)の中身を置換
Sub Replace_File(path As String, wordBef As String, wordAft As String)

    '宣言
    Dim FSO As Object, buf As String
    
    '初期設定
    Set FSO = CreateObject("Scripting.FileSystemObject")
    
    With FSO.GetFile(path).OpenAsTextStream
    buf = .ReadAll
    .Close
    End With
    
    FSO.GetFile(path).Delete
    FSO.CreateTextFile path
    
    buf = Replace(buf, wordBef, wordAft)
    
    With FSO.GetFile(path).OpenAsTextStream(8)
    .Write buf
    .Close
    End With
    
    Set FSO = Nothing

End Sub