比较2张2列,但过滤苹果从菠萝像蛇从响尾蛇

嗨,我有我的朋友之前在这里使用它基本上创build的代码。 唯一的区别是我的代码使用动物,而他的使用成果。 谁能告诉我如何过滤可以说,从响尾蛇和菠萝苹果,因为使用他从菠萝苹果检测到的水果。 这是我的代码。 请build议,如果我的问题是一个混乱善意地把我所以我可以更清楚。 对不起我的英语不好。

Sub lookup() Dim TotalRows As Long Dim rng As Range Dim i As Long 'Copy lookup values from sheet1 to sheet3 Sheets("Sheet1").Select TotalRows = ActiveSheet.UsedRange.Rows.Count Range("A1:A" & TotalRows).Copy Destination:=Sheets("Sheet3").Range("A1") 'Go to the destination sheet Sheets("Sheet3").Select For i = 1 To TotalRows 'Search for the value on sheet2 Set rng = Sheets("Sheet2").UsedRange.Find(Cells(i, 1).Value) 'If it is found put its value on the destination sheet If Not rng Is Nothing Then Cells(i, 2).Value = rng.Value End If Next End Sub 

需要帮忙。 谢谢。

我find了我的问题的答案

我刚刚search了苹果,然后把它变成苹果,变得更加独特。

这是代码

 Dim cl As Range For Each cl In Range ("Q10:Q1000") If cl Like "apple" Then cl = "apples" End if Next cl