|
Sub ss()
Dim arr(), sh As Worksheet
n = Application.InputBox("请输入要统计的工作表个数:", , , , , , 1) '要统计的工作表放在前面
With Sheets("sheet3")
For x = 1 To n
For y = 6 To Sheets(x).Range("A5").End(xlDown).Row
n = .Range("B65536").End(xlUp).Row + 1
If Sheets(x).Cells(y, 4) > 0 Then
.Cells(n, 2) = Sheets(x).Cells(y, 2)
.Cells(n, 3) = Sheets(x).Cells(y, 3)
.Cells(n, 4) = Sheets(x).Cells(y, 4)
End If
Next y
Next x
End With
End Sub
|
|