|
- Sub hz()
- Dim sh As Worksheet, shn As String
- Dim arr As Variant, i As Integer, j As Integer, k As Integer
- Dim jg(1 To 10000, 1 To 7)
- shn = Me.Name
- For Each sh In Sheets
- With sh
- If .Name <> shn Then
- arr = .[a1].CurrentRegion.Value
- For i = 2 To UBound(arr)
- k = k + 1
- For j = 1 To 7
- jg(k, j) = arr(i, j)
- If arr(i, 1) = "" Then jg(k, 1) = jg(k - 1, 1)
- If arr(i, 2) = "" Then jg(k, 2) = jg(k - 1, 2)
- Next
- Next
- End If
- End With
- Next
- [a1].CurrentRegion.Clear
- Sheet1.[a1:h1].Copy [a1]
- [a2].Resize(k, 7).Value = jg
- PivotTables("数据透视表1").PivotCache.Refresh
- End Sub
复制代码
弄了个透视表, |
|