Excel 如何在句子列中查找单词集,并将创建的单词粘贴到可用单元格的同一行中

Excel 如何在句子列中查找单词集,并将创建的单词粘贴到可用单元格的同一行中,excel,Excel,我有一个a栏,里面有句子 Column a Column b Column c Sentences Word 1 Word 2 1 Sentence 1 Sentence 2 在特定的列中,我需要找到一组关键字,如 Column J Column K Word 1.1 Word 2.1 Word 1.2 Word 2.2 Word 1.3 Word 2.3 Word 1.4 Word 2.4 如果列A中存在上述任何关键字,则应将其粘

我有一个a栏,里面有句子

Column a    Column b Column c  

Sentences   Word 1  Word 2  1
Sentence 1
Sentence 2
在特定的列中,我需要找到一组关键字,如

Column J  Column K

Word 1.1    Word 2.1 
Word 1.2    Word 2.2
Word 1.3    Word 2.3    
Word 1.4    Word 2.4

如果列A中存在上述任何关键字,则应将其粘贴到同一行的下一个可用单元格上

Column a   Column b    Column c

Sentences   Word 1     Word 2   
Sentence 1  Word 1.1
Sentence 2  Word 2.4
Dim col作为范围,cell作为对象 Dim col1作为范围,cell1作为对象 Application.ScreenUpdating=False SheetsKeyword。选择 范围A1.选择 RangeSelection,Selection.EndxlDown.Select 设置col=选择 SheetsData。选择 范围B1.选择 RangeSelection,Selection.EndxlDown.Select 设置col1=Selection 对于col中的每个单元格 范围B1.选择 RangeSelection,Selection.EndxlDown.Select 范围B2.选择 RangeSelection,Selection.EndxlDown.Select 第1行: Selection.FindWhat:=bone,After:=ActiveCell,LookIn:=xlFormulas_ 查看:=xlPart,搜索顺序:=xlByRows,搜索方向:=xlNext_ MatchCase:=False,SearchFormat:=False.Activate ActiveCell。选择 ActiveCell.Offset0,1.选择 ActiveCell.Value=cell Cells.FindNextAfter:=ActiveCell.Activate 后藤1号线 此代码将在A列中的所有相邻单元格中循环,如果找到bone,则将使行中的下一个可用单元格等于bone


您的代码似乎与您所说的您试图实现的目标不一致。这应该让你开始

@Kyle cell.offset0500.endxlleft=bone

声明不起作用。我已经用下面的代码成功了

对于i=1到50 如果cell.Offset0,i.Value=则 cell.Offset0,i.值=标记 退出 如果结束
下一个icell.offset0500.endxlleft=骨骼
Dim col As Range, cell As Range
Dim col1 As Range, cell1 As Range
Application.ScreenUpdating = False

Set col = Sheets("Keyword").Range("a1:" & Sheets("Keyword").Range("a1").end(xldown).addresslocal)

For Each cell In col
   If instr(1,cell,"bone") <> 0 then
      cell.offset(0,500).end(xltoleft) = "bone"
   end if
Next cell