我有一些代碼可以搜索我需要複製的文本,但是我意識到這些代碼正在執行公式。我需要它來簡單地粘貼單元格的值。我不確定如何編輯以下內容以實現此目的。有什麼想法嗎?編輯代碼只複製值而不是公式
With Initiatives.Range("B3:B500")
Rcount = 0
For I = LBound(MyArr) To UBound(MyArr)
Set Rng = .Find(What:=MyArr(I), _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
FirstAddress = Rng.Address
Do
Rcount = Rcount + 1
Rng.EntireRow.Copy NewSh.Rows(Rcount)
Set Rng = .FindNext(Rng)
Loop While Not Rng Is Nothing And Rng.Address <> FirstAddress
End If
Next I
End With
'NewSh.Rows(Rcount時).value的= Initiatives.Rows(Rng.Row).value' –
@ScottCraner運作良好謝謝!如果你把它作爲答案發布,我會非常樂意接受它來結束這個問題。作爲一個方面說明,我將如何修改這個也複製格式但不是公式? – TonyP