Thread: [Solved] copy a paragraph
View Single Post
 
Old 12-12-2024, 04:26 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Your procedure seems to work here. You could try to simplifiy:

Code:
Sub COPYPAR()
Dim oPar As Paragraph, oRng As Range
  Set oPar = Selection.Paragraphs(1)
  Set oRng = oPar.Range
  With oRng.Find
    .ClearFormatting
    .Text = "="
    If .Execute Then
      oRng.Start = oPar.Range.Start
      oPar.Range.InsertAfter oRng.FormattedText & vbCr
    End If
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote