|
Sub test()
Dim A, B, C, i, j, bol
i = Range("a65536").End(xlUp).Row
Sheets(1).Select
A = Range("a6:c" & i)
B = Range("h6:j" & i)
ReDim C(1 To UBound(A), 1 To UBound(A, 2))
For i = 1 To UBound(A)
'1)判断
bol = True
For j = 1 To UBound(B, 2)
If B(i, j) <> 0 Then bol = False: Exit For
Next j
'2)处理
If bol Then
For j = 1 To UBound(A, 2)
C(i, j) = A(i, j)
Next j
End If
Next i
[p6].Resize(i - 1, j - 1) = C '如果OK,p6改为L6
End Sub |
|