|
- Sub Rep()
- Dim Fn, Co, L, I
- With CreateObject("Adodb.Stream")
- .Type = 2
- .Mode = 3
- For I = 3 To 8
- Fn = ThisWorkbook.Path & "\需替换文件" & Sheet2.Cells(I, 1) & ".b5r"
- .CharSet = "Utf-8" 'CheckCode(Fn)
- .Open
- .LoadFromFile Fn
- L = .Readtext
- .Close
- L = Replace(L, ">" & Sheet2.Cells(I, 3) & "<" & Sheet2.Cells(I, 2), ">" & Sheet2.Cells(I, 4) & "<" & Sheet2.Cells(I, 2))
- L = Replace(L, Sheet2.Cells(I, 7) & ">" & Sheet2.Cells(I, 8) & "</", Sheet2.Cells(I, 7) & ">" & Sheet2.Cells(I, 9) & "</")
- .Open
- .WriteText L
- .SaveToFile Fn, 2
- .Flush
- .Close
- Next
- End With
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|