View Single Post
 
Old 04-29-2020, 08:49 PM
Benali Benali is offline Windows 10 Office 2013
Novice
 
Join Date: Apr 2020
Posts: 10
Benali is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
I got the impression that Benali wants to get rid of the time stamps completely and merge the content into a single paragraph. When I copy/pasted from the original post, the lines were separated by a soft return rather than a paragraph mark so I'm going to assume that is what the code needs to work with.

If the above assumptions are right, building on from Paul's code try...
Code:
Sub Demo()
  Application.ScreenUpdating = False
  With ActiveDocument.Range
    With .Find
      .ClearFormatting
      .Replacement.ClearFormatting
      .Text = "([0-9:]{5})"
      .Replacement.Text = " "
      .Forward = True
      .Format = False
      .Wrap = wdFindContinue
      .MatchWildcards = True
      .Execute Replace:=wdReplaceAll
      .Text = "^l"   'or ^13
      .Replacement.Text = ""
      .Execute Replace:=wdReplaceAll
    End With
  End With
  Application.ScreenUpdating = True
End Sub
when i run this code it takes away the numbers but does not place the line to the one above and make a complete sentence

Its like this


I sing sit home all morning really but

then you stepped up I'm glad but there's

not enough room for both of us this

morning so I'm gonna pass um we got a


and wish to have this:

I sing sit home all morning really but then you stepped up I'm glad but there's not enough room for both of us this morning so I'm gonna pass um we got a
Reply With Quote