Sub ss()
Dim arr(), sh As Worksheet
n = Application.InputBox("请输入要统计的工作表个数:", , , , , , 1) '要统计的工作表放在前面
With Sheets("sheet1")
For x = 1 To n
For y = 60 To Sheets(x).Range("C59").End(xlDown).Row
m = .Range("B150").End(xlUp).Row + 1
Set sh = Sheets(x)
If sh.Cells(y, 13) > 0 Then
.Cells(m, 7) = sh.Cells(y, 7)
.Cells(m, 8) = sh.Cells(y, 8)
.Cells(m, 9) = sh.Cells(y, 9)
.Cells(m, 13) = sh.Cells(y, 13)
End If
Next y
Next x
End With
End Sub |