|
- Sub mergeSheet()
- Dim i, j As Integer
- Dim arr As Variant
- Dim count As Integer
- Dim newData As Variant
- Dim maxNon As Integer
- Sheets("信息汇总表").Range("B3:Q500").ClearContents
- For i = 1 To Worksheets.count
- If Sheets(i).Name <> "信息汇总表" Then
- With Sheets(i)
- maxR = .Range("A" & .Rows.count).End(xlUp).Row
- arr = .Range("A2:G" & maxR).Value
- ' For j = 1 To UBound(arr, 1)
- newData = Array(arr(2, 2), arr(2, 5), arr(3, 2), arr(2, 7), arr(3, 5), arr(3, 7), _
- arr(5, 2), arr(5, 7), arr(4, 2), arr(7, 2), arr(7, 7), arr(6, 2), arr(6, 5), arr(6, 7), arr(4, 6))
- With Sheets("信息汇总表")
- maxNon = .Range("B" & .Rows.count).End(xlUp).Row
- .Range("B" & (maxNon + 1)).Resize(1, UBound(newData) + 1) = newData
- End With
- ' Next j
- End With
-
- End If
- Next
- End Sub
复制代码 |
|