View Single Post
 
Old 02-19-2023, 07:00 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Try this method
Code:
Sub Get2DaChopper()
  Dim str As String, oRng As Range, arr() As String, i As Integer
  Set oRng = ActiveDocument.Range
  With oRng.Find
    Do While .Execute(findText:="#")
      arr = Split(oRng.Paragraphs(1).Range.Text, "#")
      For i = 1 To UBound(arr)
        str = str & arr(0) & vbCr
      Next i
     Set oRng = oRng.Paragraphs(1).Range
     oRng.Collapse Direction:=wdCollapseEnd
     oRng.End = ActiveDocument.Range.End
    Loop
  End With
  Debug.Print str
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote