|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 合并()
Dim sh As Worksheet
Dim ar As Variant
Dim br()
ReDim br(1 To 100000, 1 To 32)
With Sheets("合并")
.UsedRange.Clear
For Each sh In Sheets
If sh.Name <> "合并" Then
r = sh.Cells(sh.Rows.Count, 4).End(xlUp).Row
ar = sh.Range("d6:ai" & r)
For i = 1 To UBound(ar)
If ar(i, 1) <> "" Then
n = n + 1
For j = 1 To UBound(ar, 2)
br(n, j) = ar(i, j)
Next j
End If
Next i
End If
Next sh
.[b2].Resize(n, UBound(br, 2)) = br
End With
MsgBox "ok!"
End Sub
|
|