Excel:在另一个表格的表格中search字词,如果find任何字词,请在当前单元格中的单元格旁插入值

一直试图find一个macros,它将逐行查看列(工作列a),并在另一个表中search表(列表列a)中的任何单词。 如果find这些单词中的任何一个,它将返回下一列(列表b)的值,并将其放入工作表(工作栏c)中的一个单元格中,然后按行逐行向下工作表。

这是可能的macros吗? 我知道如果然后其他公式被列入7项,并即时通讯工作与一个更长的名单,(和增长)

在所有表单中replace范围中定义的所有expression式的示例:

Sub ReplaceMulti() Dim dictionary As Range, sh As Worksheet, data(), r&, search$, replace$ ' Loads a translation table from a worksheet ' The first column is the searched string and the second is the replacement Set dictionary = [Sheet1!A1:B10] data = dictionary.value ' iterate each sheet For Each sh In ActiveWorkbook.Worksheets ' skip the sheet with the dictionary If sh.CodeName <> dictionary.Worksheet.CodeName Then ' iterate each expression For r = 1 To UBound(data) If Not IsEmpty(data(r, 1)) Then search = data(r, 1) replace = data(r, 2) ' replace in the sheet sh.Cells.replace What:=search, replacement:=replace, _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _ SearchFormat:=False, ReplaceFormat:=False End If Next End If Next End Sub