查找多个符号并一次性替换(vba)
我可以一次找到并替换多个字母或符号吗 我可以使用: selection.find.text=“(){}” 代替此方法:查找多个符号并一次性替换(vba),vba,Vba,我可以一次找到并替换多个字母或符号吗 我可以使用: selection.find.text=“(){}” 代替此方法: Dim b As String Dim c As Integer Dim punk As String punk = "({})""" b = Selection.Range.Characters.First c = InStr( punk, b) If c = 5 Then GoTo x ElseIf c = 2 Then GoT
Dim b As String
Dim c As Integer
Dim punk As String
punk = "({})"""
b = Selection.Range.Characters.First
c = InStr( punk, b)
If c = 5 Then
GoTo x
ElseIf c = 2 Then
GoTo y
End If
Exit Sub
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
y: With Selection.Find
.Text = "}"
.Replacement.Text = ""
' a = Selection.Text
.Forward = True
.Wrap = wdFindStop
Selection.InsertAfter ChrW(64830)
Selection.InsertBefore ChrW(64831)
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.MatchSuffix = False
.MatchPrefix = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Exit Sub
End If