![]() |
|
#1
|
|||
|
|||
|
Hi all,
I have a document with over 500 pages. and I would like to be able to delete all the text between the word DOLLAR VALUE and the information after that. Here is how the information is showing in the document: HTML Code:
BRITTANY 1
SICK LEAVE REGULAR HOURS 7.50 77.50 40.25
ANNUAL LEAVE REGULAR HOURS 7.50 19.75
DOLLAR VALUE
KARIN 1
SICK LEAVE REGULAR HOURS 4.00 14.75 7.50 286.00
ANNUAL LEAVE REGULAR HOURS 5.75 21.25 261.25 89.25
DOLLAR VALUE 65.44 2973.03
LACOURTNEY 1
SICK LEAVE REGULAR HOURS 14.50
ANNUAL LEAVE REGULAR HOURS 59.50 59.50
DOLLAR VALUE 631.30*
ALYSSA 1
SICK LEAVE REGULAR HOURS 3.50 15.00 105.25
ANNUAL LEAVE REGULAR HOURS 3.50 15.00 37.75
DOLLAR VALUE 37.49 404.30
Here is how the information should looks after applying the macro: HTML Code:
BRITTANY 1
SICK LEAVE REGULAR HOURS 7.50 77.50 40.25
ANNUAL LEAVE REGULAR HOURS 7.50 19.75
KARIN 1
SICK LEAVE REGULAR HOURS 4.00 14.75 7.50 286.00
ANNUAL LEAVE REGULAR HOURS 5.75 21.25 261.25 89.25
LACOURTNEY 1
SICK LEAVE REGULAR HOURS 14.50
ANNUAL LEAVE REGULAR HOURS 59.50 59.50
ALYSSA 1
SICK LEAVE REGULAR HOURS 3.50 15.00 105.25
ANNUAL LEAVE REGULAR HOURS 3.50 15.00 37.75
As always, thank you in advance for your assistance and cooperation. Regards! |
|
#2
|
|||
|
|||
|
You don't need a macro. A wildcard search and replace should so the job.
|
|
#3
|
||||
|
||||
|
Search and replace for
DOLLAR VALUE*^13 with Wildcards turned on
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#4
|
||||
|
||||
|
I'd be inclined to use a wildcard Find/Replace where:
Find = ^13[!^13]@DOLLAR VALUE*^13 Replace = ^p That'll delete the leading spaces in the 'DOLLAR VALUE' lines as well.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#5
|
|||
|
|||
|
Thank you all for your responses, and the wildcard Find/Replace did the job.
Excellent. Much appreciated. |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro to delete text in specific styles
|
ljd108 | Word VBA | 14 | 01-22-2019 01:22 PM |
Macro to delete rows not containing specific text
|
Alimou | Excel Programming | 4 | 02-06-2017 07:35 AM |
Macro to delete text from cells with specific format
|
Soenke | Word VBA | 4 | 09-01-2016 08:55 AM |
| Microsoft Word macro to find text, select all text between brackets, and delete | helal1990 | Word VBA | 4 | 02-05-2015 03:52 PM |
Macro Delete Selected Text
|
smonczka | Word VBA | 2 | 11-05-2011 03:18 AM |