Sub ParenthesesEtcPairDelete() ' Paul Beverley - Version 09.03.21 ' Removes the following pair of parentheses or quotes, etc. numChars = 20 numWords = 50 op = "" cl = "" If Selection.Start = Selection.End Then Selection.End = Selection.Start + numChars If op = "" And InStr(Selection, """") > 0 Then op = """" cl = """" End If If op = "" And InStr(Selection, "[") > 0 Then op = "[" cl = "]" End If If op = "" And InStr(Selection, "{") > 0 Then op = "{" cl = "}" End If If op = "" And InStr(Selection, "<") > 0 Then op = "<" cl = ">" End If If op = "" And InStr(Selection, "(") > 0 Then op = "(" cl = ")" End If If op = "" And InStr(Selection, ChrW(8220)) > 0 Then op = ChrW(8220) cl = ChrW(8221) End If If op = "" And InStr(Selection, ChrW(8216)) > 0 Then op = ChrW(8216) cl = ChrW(8217) End If If op = "" And InStr(Selection, ",") > 0 Then op = "," cl = "," End If If cl = "" Then Beep MsgBox "Please move the cursor nearer to your target character." Exit Sub End If Selection.Collapse wdCollapseStart Selection.MoveEnd wdWord, numWords If InStr(Selection, cl) = 0 Then Beep Exit Sub End If Selection.Collapse wdCollapseStart Selection.MoveEndUntil cset:=op, Count:=wdForward Selection.Collapse wdCollapseEnd Selection.MoveEnd , 1 Selection.Delete Selection.MoveEndUntil cset:=cl, Count:=wdForward Selection.Collapse wdCollapseEnd Selection.MoveEnd , 1 Selection.Delete End Sub