|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub qq()
- Cells.Clear
- Dim mapath$, maname$, wb As Workbook, ws As Worksheet, s$, r%
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- mapath = ThisWorkbook.Path & ""
- maname = Dir(mapath & "*初审*.xlsx")
- Do While maname <> ""
- If maname <> ThisWorkbook.Name Then
- r = r + 2
- Set wb = Workbooks.Open(mapath & maname)
- For Each ws In wb.Sheets
- s = ws.Name
- If InStr(s, "成本单(表3)") Then
- ws.[a1].CurrentRegion.Copy ThisWorkbook.Sheets("sheet1").Range("a" & r)
- End If
- Next
- End If
- wb.Close
- maname = Dir
- r = Cells(Rows.Count, 1).End(xlUp).Row
- Loop
- End Sub
复制代码 |
|