0
目前我有宏在另一個文檔中查找並複製偏移單元格,如果存在一個值。我已經有了下面的代碼(只有選擇/複製偏移單元格的部分),但它只會複製一行。這對於我正在尋找的大部分物品都很好。有誰知道如何修改下面的代碼來複制包含我的搜索值的所有單元格?在一個範圍內複製多行
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