|
参与一下。。。- Sub ykcbf() '//2024.1.9
- Dim ws, wb, arr
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- p = ThisWorkbook.Path & "\2024\01"
- With Sheets("Team member information")
- r = .Cells(Rows.Count, 2).End(3).Row
- arr = .Range("a1:f" & r)
- End With
- 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 ws = Workbooks.Open(f, 0)
- Set sh = ws.Sheets(1)
- For i = 2 To UBound(arr)
- fn = arr(i, 2)
- sh.Copy
- Set wb = ActiveWorkbook
- With wb.Sheets(1)
- .[d9] = fn
- .[d12] = arr(i, 4)
- .[k9] = arr(i, 3)
- .[i12] = arr(i, 5)
- .[k12] = arr(i, 6)
- .[j56] = arr(i, 4)
- End With
- wb.SaveAs p & "122024_" & fn
- wb.Close 1
- Next
- ws.Close False
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|