|
参与一下。。。
- Sub ykcbf() '//2024..8.3
- Application.ScreenUpdating = False
- Set sh = ThisWorkbook.Sheets("Sheet2")
- With Application.FileDialog(msoFileDialogFilePicker)
- .InitialFileName = ThisWorkbook.Path
- .Title = "请选择对应Excel文件"
- .AllowMultiSelect = False
- .Filters.Clear
- .Filters.Add "Excel文件", "*.xls*"
- If .Show Then f = .SelectedItems(1) Else Exit Sub
- End With
- Set wb = Workbooks.Open(f, 0)
- With wb.Sheets("Sheet2")
- arr = .[A32:V46]
- wb.Close False
- End With
- With sh
- Set Rng = .Columns("AG:AG").Find(999)
- r = Rng.Row: c = Rng.Column
- .Cells(r, c).Resize(UBound(arr), UBound(arr, 2)) = arr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|