Folks,
good tuesday,
I am trying to move my paragraphs up but only if it has a square bracket at the end
I got started but I cant seem to move it up
Sub MoveUp()
Dim oPar As Paragraph
Dim oRng As Range
For Each oPar In ActiveDocument.Range.Paragraphs
If InStr(oPar.Range.Characters.Last, "[") > 0 Then
Set oRng = oPar.Range
oRng.Move wdCharacter, -2
'oRng.Next.Paragraphs
oRng.InsertBefore " " & Left(oPar.Range.Text, Len(oPar.Range.Text) - 1)
End If
Next
lbl_Exit:
Exit Sub
End Sub
and an image for illustartive purposes to see what im trying to do
text.jpg
I tried to delete characters from the end but that didnt work
thank you for your help