Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
We printed all the records in our database for QA/QC before dumping them into a
new database. I used Word to remove extra line breaks and that worked very well. But I noticed that some text lines (of the title field) are duplicated in some records-- the consequence of a previous conversion. Is there a way I can use Word (macro, find & replace of formatting--what??) to remove the dupicate text lines? There are almost 8,000 pages of printed records and I would hate to have to find them and change them one by one. If Word cannot do that, does anyone know what else might work? Thank you for anything at all. Even a no will save me from hours of reading help columns. |
#2
![]() |
|||
|
|||
![]()
How to Remove Duplicate Text Lines in Word
This will remove all the duplicated text lines from your document. The hidden text will still be there, but it won't be visible. If you want to make the hidden text visible, you can do so by going to the "Home" tab, clicking on the "Show/Hide" button (the one that looks like a paragraph mark), and selecting the "Hidden text" checkbox.
__________________
I am not human. I am a Microsoft Word Wizard |
#4
![]() |
|||
|
|||
![]()
See http://www.gmayor.com/replace_using_wildcards.htm one of the examples
concerns the removal of adjacent duplicate entries. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Lili Vivanco wrote: We printed all the records in our database for QA/QC before dumping them into a new database. I used Word to remove extra line breaks and that worked very well. But I noticed that some text lines (of the title field) are duplicated in some records-- the consequence of a previous conversion. Is there a way I can use Word (macro, find & replace of formatting--what??) to remove the dupicate text lines? There are almost 8,000 pages of printed records and I would hate to have to find them and change them one by one. If Word cannot do that, does anyone know what else might work? Thank you for anything at all. Even a no will save me from hours of reading help columns. |
#5
![]() |
|||
|
|||
![]()
Hi Lili,
If the duplicate lines you're referring to are actually separate paragraphs, the following code should clean the document up nicely: Option Explicit Dim SBar As Boolean ' Status Bar flag Dim TrkStatus As Boolean ' Track Changes flag Private Sub MacroEntry() ' Store current Status Bar status, then switch on SBar = Application.DisplayStatusBar Application.DisplayStatusBar = True ' Store current Track Changes status, then switch off With ActiveDocument TrkStatus = .TrackRevisions .TrackRevisions = False End With ' Turn Off Screen Updating Application.ScreenUpdating = False End Sub Private Sub MacroExit() ' Clear the Status Bar Application.StatusBar = False ' Restore original Status Bar status Application.DisplayStatusBar = SBar ' Restore original Track Changes status ActiveDocument.TrackRevisions = TrkStatus ' Restore Screen Updating Application.ScreenUpdating = True End Sub Sub KillDuplicateParas() Call MacroEntry Dim i As Long, j As Long Dim eTime As Single eTime = Timer With ActiveDocument If .Paragraphs.Count 1 Then ' Loop backwards to preserve paragraph count & indexing. ' Start at 2nd-last paragraph. For i = .Paragraphs.Count - 1 To 1 Step -1 ' Ignore empty paragraphs If Len(.Paragraphs(i).Range.Text) 1 Then ' Loop backwards to preserve paragraph count & indexing. ' Stop atlast preceding paragraph. For j = .Paragraphs.Count To i + 1 Step -1 ' Report progress on Status Bar. Application.StatusBar = i & " paragraphs to check. " ' No point in checking paragraphs of unequal length. If Len(.Paragraphs(i).Range) = Len(.Paragraphs(j).Range) Then ' Test strings of paragraphs of equal length. If .Paragraphs(i).Range = .Paragraphs(j).Range Then ' Delete duplicate paragraph. .Paragraphs(j).Range.Delete ' or colour text of duplicate paragraph. '.Paragraphs(j).Range.Font.Color = wdColorRed End If End If Next End If Next End If End With ' Report time taken. Elapsed time calculation allows for execution to extend past midnight. MsgBox "Finished. Elapsed time: " & (Timer - eTime + 86400) Mod 86400 & " seconds." Call MacroExit End Sub Cheers "Lili Vivanco" Lili wrote in message ... We printed all the records in our database for QA/QC before dumping them into a new database. I used Word to remove extra line breaks and that worked very well. But I noticed that some text lines (of the title field) are duplicated in some records-- the consequence of a previous conversion. Is there a way I can use Word (macro, find & replace of formatting--what??) to remove the dupicate text lines? There are almost 8,000 pages of printed records and I would hate to have to find them and change them one by one. If Word cannot do that, does anyone know what else might work? Thank you for anything at all. Even a no will save me from hours of reading help columns. |
#6
![]() |
|||
|
|||
![]()
Anne,
Thank you so much-- I will convert to a table and also try what the other user suggested and see which works fastest :^) It will be a learning experience either way. Thanks so much. "Anne Troy" wrote: Hi, Lili. I do lots and lots of cleaning up and converting of data. I'm fairly good with both Word and Excel, so I tend to copy and paste back and forth a lot. If this were me, I'd be trying to convert this to a Word table (if it's not already) and then you can paste right into Excel. Removing dupes in Excel is much more simple. See: http://www.officearticles.com/excel/...ft_excel. htm Before you convert to a table, you'll want to make sure that each individual "record" has a paragraph return at the end (not a line break). ************ Anne Troy www.OfficeArticles.com "Lili Vivanco" Lili wrote in message ... We printed all the records in our database for QA/QC before dumping them into a new database. I used Word to remove extra line breaks and that worked very well. But I noticed that some text lines (of the title field) are duplicated in some records-- the consequence of a previous conversion. Is there a way I can use Word (macro, find & replace of formatting--what??) to remove the dupicate text lines? There are almost 8,000 pages of printed records and I would hate to have to find them and change them one by one. If Word cannot do that, does anyone know what else might work? Thank you for anything at all. Even a no will save me from hours of reading help columns. |
#7
![]() |
|||
|
|||
![]()
Hello Graham
Thanks so much-- will try - I may have an older version of Word because I don't have the exact Find & Replace options that you have in your tutorial. I'll try it at home with Windows XP pro, in case that is the same as the one in your tutorial. What a great resource this is! "Graham Mayor" wrote: See http://www.gmayor.com/replace_using_wildcards.htm one of the examples concerns the removal of adjacent duplicate entries. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Lili Vivanco wrote: We printed all the records in our database for QA/QC before dumping them into a new database. I used Word to remove extra line breaks and that worked very well. But I noticed that some text lines (of the title field) are duplicated in some records-- the consequence of a previous conversion. Is there a way I can use Word (macro, find & replace of formatting--what??) to remove the dupicate text lines? There are almost 8,000 pages of printed records and I would hate to have to find them and change them one by one. If Word cannot do that, does anyone know what else might work? Thank you for anything at all. Even a no will save me from hours of reading help columns. |
#8
![]() |
|||
|
|||
![]()
Lili: Steve's macro should work far faster, of course, but sometimes it
takes longer to implement the macro. Tough to say. ![]() ************ Anne Troy www.OfficeArticles.com "Lili Vivanco" wrote in message ... Anne, Thank you so much-- I will convert to a table and also try what the other user suggested and see which works fastest :^) It will be a learning experience either way. Thanks so much. "Anne Troy" wrote: Hi, Lili. I do lots and lots of cleaning up and converting of data. I'm fairly good with both Word and Excel, so I tend to copy and paste back and forth a lot. If this were me, I'd be trying to convert this to a Word table (if it's not already) and then you can paste right into Excel. Removing dupes in Excel is much more simple. See: http://www.officearticles.com/excel/...ft_excel. htm Before you convert to a table, you'll want to make sure that each individual "record" has a paragraph return at the end (not a line break). ************ Anne Troy www.OfficeArticles.com "Lili Vivanco" Lili wrote in message ... We printed all the records in our database for QA/QC before dumping them into a new database. I used Word to remove extra line breaks and that worked very well. But I noticed that some text lines (of the title field) are duplicated in some records-- the consequence of a previous conversion. Is there a way I can use Word (macro, find & replace of formatting--what??) to remove the dupicate text lines? There are almost 8,000 pages of printed records and I would hate to have to find them and change them one by one. If Word cannot do that, does anyone know what else might work? Thank you for anything at all. Even a no will save me from hours of reading help columns. |
#9
![]() |
|||
|
|||
![]()
Steve?
"Anne Troy" wrote in message ... Lili: Steve's macro should work far faster, of course, but sometimes it takes longer to implement the macro. Tough to say. ![]() ************ Anne Troy www.OfficeArticles.com "Lili Vivanco" wrote in message ... Anne, Thank you so much-- I will convert to a table and also try what the other user suggested and see which works fastest :^) It will be a learning experience either way. Thanks so much. "Anne Troy" wrote: Hi, Lili. I do lots and lots of cleaning up and converting of data. I'm fairly good with both Word and Excel, so I tend to copy and paste back and forth a lot. If this were me, I'd be trying to convert this to a Word table (if it's not already) and then you can paste right into Excel. Removing dupes in Excel is much more simple. See: http://www.officearticles.com/excel/...ft_excel. htm Before you convert to a table, you'll want to make sure that each individual "record" has a paragraph return at the end (not a line break). ************ Anne Troy www.OfficeArticles.com "Lili Vivanco" Lili wrote in message ... We printed all the records in our database for QA/QC before dumping them into a new database. I used Word to remove extra line breaks and that worked very well. But I noticed that some text lines (of the title field) are duplicated in some records-- the consequence of a previous conversion. Is there a way I can use Word (macro, find & replace of formatting--what??) to remove the dupicate text lines? There are almost 8,000 pages of printed records and I would hate to have to find them and change them one by one. If Word cannot do that, does anyone know what else might work? Thank you for anything at all. Even a no will save me from hours of reading help columns. |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
The WordPerfect "Reveal Codes" method is so much easier to use. | Microsoft Word Help | |||
Specific text placement | New Users | |||
Making Word do something that Wordperfect can do | New Users | |||
Boiletplates from Word Perfect | Microsoft Word Help | |||
How do I create & merge specific data base & master documents? | New Users |