本帖最后由 small_small 于 2021-10-26 08:14 编辑
- Sub huizong()
- Dim arr, n As Byte, i As Integer, wk
- arr = Application.GetOpenFilename(, , , , True)
- If IsArray(arr) = False Then Exit Sub
- i = 1
- For n = 1 To UBound(arr)
- i = i + 1
- Set wk = Workbooks.Open(arr(n))
- With ThisWorkbook.Sheets("Sheet1")
- .Cells(i, 1) = [f4]
- .Cells(i, 2) = [x4]
- .Cells(i, 3) = [f5]
- .Cells(i, 4) = [x5]
- .Cells(i, 5) = [ai5]
- .Cells(i, 6) = [f6]
- .Cells(i, 7) = [x6]
- .Cells(i, 8) = [ai6]
- .Cells(i, 9) = [f7]
- .Cells(i, 10) = [x7]
- .Cells(i, 11) = [ai7]
- ' .Cells(i, 12) = [f8]
- .Cells(i, 12) = [ae8]
- End With
- wk.Close 0
- Set wk = Nothing
- Next n
- End Sub
复制代码 |