Forum Discussion
inarbeth
Jan 31, 2024Copper Contributor
Macro to remove brackets
I wonder if any VBA experts can help. I found online the following macro to remove square brackets. Sub RemoveSquareBrackets() Dim oRng As Range Set oRng = ActiveDocument.Range With oRng.Find ...
Feb 01, 2024
inarbeth Use
Dim oRng As Range
Set oRng = Selection.Range
With oRng
.Start = ActiveDocument.Range.Start
.Start = .Start + InStrRev(.Text, "(") - 1
.End = ActiveDocument.Range.End
.End = .Start + InStr(.Text, ")")
.Characters(1).Delete
.Characters(.Characters.Count).Delete
.Select
End With