|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub qs()
- Application.ScreenUpdating = False
- Dim arr, i, wb As Workbook, xb As Workbook
- Dim FileName
- Set wb = ThisWorkbook
- FileName = Application.GetOpenFilename(FileFilter:="Excel 工作簿文件 (*.xls*),*.xls*", Title:="请选择文件", MultiSelect:=True)
- If Not IsArray(FileName) Then
- MsgBox "没有选择文件"
- Exit Sub
- End If
- For Each f In FileName
- Set xb = Workbooks.Open(f, 0)
- rw = xb.Sheets(1).Cells(Rows.Count, "d").End(3).Row
- r = wb.Sheets(1).Cells(Rows.Count, 1).End(3).Row + 1
- xb.Sheets(1).Range("a" & rw & ":r" & rw).Copy wb.Sheets(1).Range("a" & r)
- x = Mid(f, VBA.InStrRev(f, "") + 1)
- wb.Sheets(1).Hyperlinks.Add wb.Sheets(1).Range("s" & r), f, , , x
- xb.Close (0)
- Next f
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|