|
参与一下。。。
- Sub 导入工单表头() '//2024.12.16
- Application.ScreenUpdating = False
- Set Sh = ThisWorkbook.Sheets("贴工单表头")
- 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)
- arr = wb.Sheets(1).UsedRange
- wb.Close False
- With Sh
- .UsedRange.Clear
- .Columns(1).NumberFormatLocal = "@"
- .[a1].Resize(UBound(arr), UBound(arr, 2)) = arr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|