現在、別のドキュメントを調べて、値が存在する場合はオフセット セルをコピーするマクロがあります。以下のコード (オフセット セルを選択/コピーする部分のみ) は既にありますが、コピーされるのは 1 行だけです。これは、私が探しているほとんどのアイテムで問題ありません。以下のコードを変更して、検索した値を含むすべてのセルをコピーする方法を知っている人はいますか?
For I = LBound(MyArr) To UBound(MyArr)
Set Rng = .Find(What:=MyArr(I), _
After:=.Cells(.Cells.Count), _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
FirstAddress = Rng.Address
Do
'mark the cell in the column to the right if "Ron" is found
Rng.Offset(0, 4).Select
'Rng.Copy "A" & Rcount
Set Rng = .FindNext(Rng)
Loop While Not Rng Is Nothing And Rng.Address <> FirstAddress
Selection.Copy (Rng)
End If
Next I
End With