Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 04-29-2020, 07:00 PM
Guessed's Avatar
Guessed Guessed is offline Want Macro to join lines and delete numbers Windows 10 Want Macro to join lines and delete numbers Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,164
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

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
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Want Macro to join lines and delete numbers Delete lines with just a number on them - use macro or find & replace? enso Word 2 05-20-2019 02:58 AM
Want Macro to join lines and delete numbers Select and Delete 2 lines after each blank line Ziad El Hachem Word VBA 4 03-21-2017 06:55 PM
Want Macro to join lines and delete numbers delete axis lines jhatter PowerPoint 2 06-04-2015 07:14 AM
How can I delete spaces & lines in a table cell mrayncrental Word VBA 3 10-20-2014 07:09 PM
Want Macro to join lines and delete numbers cannot delete these lines! userman Word 4 05-02-2012 12:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft