![](/img/trans.png)
[英]Excel VBA - Add Function to Macro to Delete Rows Containing Specific Text
[英]How Do I Get A VBA Macro In Word To Delete A Line Containing ONLY Found Text, But Not Lines Containing Found Text AND Other Text
簡而言之,我發現了多個問題和答案,這些問題和答案似乎只能滿足我的需求。
我需要做的事情將在下面進行描述:
FindText ("Find me")
If other text exists on this line Then
With Selection.Find
.Text = "Find me"
.Replacement.Text = "Found you"
.Execute Replace: [not sure what to put here]
Else delete the entire line
我知道這可能看起來有些奇怪,但這是我被要求做的事情,而且我找不到任何可以滿足我需要的答案。
編輯:要刪除的行僅是一行文本。 它僅是一條可見線,下一行在回車之后。
刪除該行下方的文檔其余部分以刪除空白時,它們應該向上移動。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.