軟體:office word
版本:2013
各位先進好,最近小弟在設定巨集的時候有一些問題想請問一下該如何解決
┌─────────┐
│AAA aaaaa │
│BBB bbbb │
│CCC CCCCcccc │
└─────────┘
┌─────────┐
│AAA aaaaa │
│BBB vvvvv │
│CC ccc cccc │
└─────────┘
因為工作需要,常要用到刪掉段落標示以及空格
之前在word 2007設定好後,都可以依照自己所選擇的表格完成
但在word 2013要重新設定時,每當選擇只跑上面的表格時,下方的表格也會跟著自己動
不知道是不是有哪裡設定錯誤?
以下是直接把VBA碼直接貼上來
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " "
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub