select符合我的查找条件的所有单元格

我正在写一个简单的macros在表中search我的值。 我知道search的值在文档中多次。 但是我的macros在表中find了第一个值。 我想要select具有我正在寻找的值的所有行。 然后我想复制选定的行并将其复制到“sheet2”。 有人可以帮我调整我的macros吗? 谢谢

Sub Vyhladat() Sheets("Sheet1").Columns(24).Find(What:=InputBox("Please enter your LR number", "Search")).Select ActiveCells.EntireRow.Select Selection.Copy Sheets("Sheet2").Select Range("A2").Select Do If IsEmpty(ActiveCell.Value) Then ActiveCell.PasteSpecial xlPasteValues End Else ActiveCell.Offset(1, 0).Select End If Loop End Sub 

这里是如何做到这一点(find第一个匹配,然后用FindNext()方法循环):

 Sub test_Jean() Dim FirstAddress As String, _ cF As Range, _ RowsToCopy As String ActiveSheet.Cells(1, 24).Activate With ActiveSheet.Columns(24) 'First, define properly the Find method Set cF = .Find(What:=InputBox("Please enter your LR number", "Search"), _ After:=ActiveCell, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False) 'If there is a result, keep looking with FindNext method If Not cF Is Nothing Then FirstAddress = cF.Address Do cF.EntireRow.Copy Sheets("Sheet2").Range("A" & Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1).PasteSpecial xlPasteValues Set cF = .FindNext(cF) 'Look until you find again the first result Loop While Not cF Is Nothing And cF.Address <> FirstAddress End If End With End Sub