Hi! I use this macro to delete an ending period at the end of a single paragraph.
Is there a way to delete the period without having to re-insert the paragraph mark?
Thanks!
Code:
Sub DeleteEndingFullStop()
Dim para As Paragraph
Dim txt As String
Set para = Selection.Paragraphs(1)
txt = para.Range.Text
' Check if paragraph ends with a period before the paragraph mark
' check the character before vbCr (ASCII 13)
If Len(txt) > 1 Then
If Mid$(txt, Len(txt) - 1, 1) = "." Then
' Remove the ending period
para.Range.Text = Left$(txt, Len(txt) - 2) & vbCr
End If
End If
End Sub