2
我已經創建了這個宏代碼使用記錄功能。創建重複的Excel宏代碼,直到沒有更多的文字提到
Sub Macro1()
Cells.Find(What:="Text to find", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Activate
Range("E5").Select
ActiveCell.FormulaR1C1 = "text to enter"
Range("D6").Select
Cells.Find(What:="Text to find", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Activate
Range("E9").Select
ActiveCell.FormulaR1C1 = "text to enter"
End Sub
我需要這個宏繼續通過同一列,直到它無法找到搜索詞中的任意多個實例,沒有它要回柱的頂部。
因此,它從一列開始,每次找到指定的單詞時,它會跨1列進行標記並粘貼到指定的單詞中。
它繼續在同一列中搜索指定的單詞,直到它無法從列的頂部開始找到它。
希望有一定道理。