Sub sousuo()
Dim r As Long
Dim c As Long
Dim str As String
Dim rng As Range
str = InputBox("输入搜索内容")
If Len(str) = 0 Then Exit Sub
c = Sheets("Sheet2").Range("A65536").End(xlUp).Row
Sheets("汇总").Activate
For r = 1 To [A65536].End(xlUp).Row
Set rng = Rows(r).Find(str, LookIn:=xlValues, LookAt:=xlPart)
If Not rng Is Nothing Then
Rows(r).Copy
c = c + 1
Worksheets("Sheet2").Range("A" & c).PasteSpecial _
Paste:=xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End If
Next
Application.CutCopyMode = False
End Sub
温馨提示:答案为网友推荐,仅供参考