|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
代码如下。。。
Sub test()
Application.ScreenUpdating = False
Set ws = ThisWorkbook.Sheets(1)
arr = ws.Range("b3:c" & ws.Cells(Rows.Count, 3).End(3).Row)
p = ThisWorkbook.Path & "\"
f = Dir(p & "*.b5r")
Do While f <> ""
With Workbooks.Open(p & f, 0).Sheets(1)
For i = 1 To UBound(arr)
If InStr(.[a83], arr(i, 1)) And InStr(.[a96], arr(i, 2)) Then
.[a83] = Replace(.[a83].Value, arr(i, 1), 4444.4)
.[a96] = Replace(.[a96].Value, arr(i, 2), 4444.4)
Exit For
End If
Next
.Parent.Close 1
End With
f = Dir
Loop
Beep
Application.ScreenUpdating = True
End Sub
|
评分
-
1
查看全部评分
-
|