|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub t()
- Dim sh, wb, f, box, r%, i%
- Set sh = Sheets.Add
- sh.Name = "汇总"
- Sheet1.[a1].Resize(1, 9).Copy sh.[a1].Resize(1, 9)
- sh.[a1].Resize(1, 9).Columns.AutoFit
- r = 2
- For Each f In Sheets
- Set wb = Sheets(f.Name).UsedRange
- For i = 1 To UBound(wb.Value)
- If (wb(i, 8) = "" Or wb(i, 9) = "") And wb(i, 2) <> "" Then
- Set box = wb(i, 1).Resize(1, 9)
- Sheets(sh.Name).Cells(r, 1).Resize(1, 9) = box.Value
- r = r + 1
- End If
- Next i
- Set wb = Nothing
- Set box = Nothing
- Next f
- Set sh = Nothing
- End Sub
复制代码 |
|