Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2016, 12:15 PM
rsrasc rsrasc is offline Need Help Deleting Numbers in Hour Format and Numbers in Sequence Windows 10 Need Help Deleting Numbers in Hour Format and Numbers in Sequence Office 2013
Competent Performer
Need Help Deleting Numbers in Hour Format and Numbers in Sequence
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default Need Help Deleting Numbers in Hour Format and Numbers in Sequence

I have a document containing more than 100 pages.



Here is a sample of how the document looks like:

123
00:07:36,529 --> 00:07:43,550
systems in the system for the system

124
00:07:39,619 --> 00:07:44,959
most solid part of the body when you

125
00:07:43,550 --> 00:07:47,509
look at them there are three

126
00:07:44,959 --> 00:07:52,959
indicators that it is all about solidity


As a first step, I would like to have a macro that will delete the hourly information from all the pages. For example, delete all the info in the following format:

00:07:44,959 --> 00:07:52,959


Also, in the document, I have a series of numbers going from 1 to 2999 with no commas or anything else. So after executing the first macro, I would like to see this information also deleted, possibly with a macro. The sample here goes from 123 to 126.

Any help is welcome and appreciate it.

Cheers!
Reply With Quote
  #2  
Old 10-12-2016, 02:49 PM
Guessed's Avatar
Guessed Guessed is offline Need Help Deleting Numbers in Hour Format and Numbers in Sequence Windows 10 Need Help Deleting Numbers in Hour Format and Numbers in Sequence Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,975
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
Code:
Sub Macro3()
  With ActiveDocument.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "^13[0-9]{1,4}^013*[0-9]{2},[0-9]{3}^013"
    .Replacement.Text = "^p"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchAllWordForms = False
    .MatchSoundsLike = False
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
  End With
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
A question about format of numbers tesoke Excel 3 03-22-2016 12:36 AM
Search a cell that contains words and numbers and convert the numbers to metric Carchee Excel Programming 36 10-08-2014 03:16 PM
Need Help Deleting Numbers in Hour Format and Numbers in Sequence Deleting a numbered section and updating subsequent numbers Gnobles Word 4 12-19-2013 07:25 AM
Need Help Deleting Numbers in Hour Format and Numbers in Sequence Deleting Page Numbers for Sections MartianTom Word 2 08-15-2013 11:50 AM
How do I refer to page numbers, when the numbers change as I prepare the document? StevenD Word 5 11-29-2012 12:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:10 AM.


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