嗨,我的问题是,当代码搜索 (i, 1) 以查找“Hello”时,它会找到它但不会将其发送到 WSS,而且我越看越沮丧,有人可以帮忙吗
Sub AddSelection()
Dim WSD As Worksheet ' Sheet 1 as prices sheet
Dim WSW As Worksheet ' Workings sheet as Information
Dim WSS As Worksheet ' Selections worksheet
Set WSD = Worksheets("Selection")
Set WSW = Worksheets("Workings")
Set WSS = Worksheets("Selections")
' Loop through records on WSD column A
FinalRow = WSD.Cells(Rows.Count, 1).End(xlUp).Row
For i = 5 To FinalRow
If WSD.Cells(i, 1) = "Hello" Then
' When I run the code this where the problem is
WSD.Cells(i, 1).Copy Destination:=WSS.Cells(NextRow, 4)
NextRow = NextRow + 2
FinalRow = WSS.Cells(Rows.Count, 1).End(xlUp).Row
End If
Next i
'Make sure WSR is the active sheet
WSS.Select
' Report that the macro is done
MsgBox prompt:=NextRow - 1 & " Results Records Are Copied To Worksheet."
End Sub