|
代码放在“汇总”表里面执行
Range("b5:j37").ClearContents
s = Cells(3, "j")
hs = 5
For I = 1 To Worksheets.Count
If Worksheets(I).Name <> "汇总" And Worksheets(I).Name <> "汇总1" Then
For k = 4 To Worksheets(I).[c10000].End(3).Row Step 13
If s = Worksheets(I).Cells(k, "j") Then
For j = k + 2 To k + 5
If IsEmpty(Worksheets(I).Cells(j, 4)) Then
Exit For
End If
Cells(hs, 2) = hs - 4
Cells(hs, 3) = Worksheets(I).Name
Cells(hs, 4) = Worksheets(I).Cells(j, 4)
Cells(hs, 6) = Worksheets(I).Cells(j, 7)
Cells(hs, 7) = Worksheets(I).Cells(j, 8)
Cells(hs, 8) = Worksheets(I).Cells(j, 9)
Cells(hs, 9) = Worksheets(I).Cells(j, 10)
Cells(hs, 10) = Worksheets(I).Cells(j, 11)
hs = hs + 1
Next j
End If
Next k
End If
Next I
关于最后的汇总,你表中有sum公式,别删它就行。 |
评分
-
查看全部评分
|