|
改为- Sub ykcbf() '//2024.3.1
- Set sh = ThisWorkbook.Sheets("Sheet1")
- p = ThisWorkbook.Path & ""
- ' f = p & "\exp_PickUp_WorkPlan_17046.xlsx"
- With Application.FileDialog(msoFileDialogFilePicker)
- .InitialFileName = p
- .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(1)
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .Range("a2:v" & r)
- wb.Close 0
- End With
- With sh
- .UsedRange.Offset(1) = ""
- .[a2].Resize(UBound(arr), UBound(arr, 2)) = arr
- End With
- MsgBox "OK!"
- End Sub
复制代码
动态选择文件
|
评分
-
1
查看全部评分
-
|