Private Sub Worksheet_Change(ByVal Target As Range)
'On Error GoTo xxx
t = Target.Address
If t <> "$B$1" And t <> "$B$2" Then Exit Sub
Application.EnableEvents = False
Application.ScreenUpdating = False
Range("a5:e65536").Clear
For Each s In ActiveSheet.Shapes
s.Delete
Next
x = 5
With Sheets("源数据")
c = "*" & Range("b1") & "*"
n = "*" & Range("b2") & "*"
For r = 2 To .Range("A65536").End(xlUp).Row
If .Cells(r, 1) Like c And .Cells(r, 2) Like n Then
.Cells(r, 1).Resize(1, 6).Copy Cells(x, 1)
x = x + 1
End If
Next
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
xxx:
End Sub 作者: wuwu200222 时间: 2019-4-8 11:00
学习