|
参与一下。。。
- Sub ykcbf() '//2024.7.27
- Set fso = CreateObject("scripting.filesystemobject")
- Set d = CreateObject("Scripting.Dictionary")
- Application.ScreenUpdating = False
- a = [{"1","2","3"}]
- b = [{"3996.8-4002.2","4002.2-3996.8","6655.6-4466.4"}]
- c = [{83,96}]
- For x = 1 To UBound(a)
- s = a(x)
- d(s) = b(x)
- Next
- p = ThisWorkbook.Path & ""
- For Each f In fso.GetFolder(p).Files
- If LCase$(f.Name) Like "*.b5r" Then
- fn = fso.GetBaseName(f)
- If d.exists(fn) Then
- t = Split(d(fn), "-")
- Set wb = Workbooks.Open(f, 0)
- With wb.Sheets(1)
- .Cells(c(1), 1) = Val(t(0))
- .Cells(c(2), 1) = Val(t(1))
- End With
- wb.Close 1
- End If
- End If
- Next f
- Application.ScreenUpdating = True
- Set d = Nothing
- MsgBox "OK!"
- End Sub
复制代码
|
|