View Full Version : Word Instructions Document in Tables - Find Duplicate Steps
Dembones
08-25-2022, 12:52 PM
I have a Word document (one of many) (150 + pages) which is laid out in tables in the document. I can delete the initial pages to reduce the main content to the tabular content. Every table row has either 2 columns or 3.
Col1 = Step No.
Col 2 = Instruction (long complex text >255 chars) which can also contain a blank sub-table
Col 3 = Text with underlining and space for someone to sign for the instruction
I'm looking for a macro to read every row in every table in the document to search for an identical entry (excluding Col 1 as this is unique). Note: these tables could be broken with a carriage return in places throughout the document.
Is this something that anyone can help me with?
macropod
08-27-2022, 02:11 PM
You say:
these tables could be broken with a carriage return in places throughout the document
In that case, you're no longer dealing with one table, but with two or more. It's not apparent how a macro is supposed to tell whether it has encountered such a table (or table series). While that might be apparent to you visually, macros don't 'see' anything.
Furthermore, you would need to tell us:
How many rows in each table?
In a 3-column table, do columns 2 & 3 both have to match, or only one of them?
What you want done when a duplicate is found?
Dembones
08-29-2022, 03:00 AM
Yes, columns 2 and 3 would have to match where the row has column 3. The document is one big table...but for formatting, some are broken across pages with CR. If macros cannot see the CR break in a table, then that is better..it will move to the next table row? I was concerned it would break the execution. The number of rows is a variable (this particular document has 136 numbered steps). I'd like the colour to change and have some way to log the other step numbers that are duplicates.
macropod
08-29-2022, 07:04 AM
The document is one big table...but for formatting, some are broken across pages with CR.
This statement is not consistent with your earlier advice:
I have a Word document (one of many) (150 + pages) which is laid out in tables in the document. ... Every table row has either 2 columns or 3.
Is it one big table, or many tables?
Likewise:
for formatting, some are broken across pages with CR. If macros cannot see the CR break in a table, then that is better..it will move to the next table row?
is not consistent with:
I have a Word document (one of many) (150 + pages) which is laid out in tables in the document. ... Every table row has either 2 columns or 3.
Carriage returns do not break a table and should not be used the way you have done. Ever heard of formatting paragraphs with the 'page break before' attribute? Carriage returns used the way you have done will definitely impact a macro that's doing comparisons.
Dembones
08-29-2022, 10:12 AM
The document was formatted by others. Happy to upload it if you have a dropbox or something.
Aussiebear
08-30-2022, 01:52 AM
Just a sample will be fine
Dembones
08-30-2022, 04:14 AM
Please refer to the attachment
Aussiebear
08-30-2022, 04:52 AM
I'm looking for a macro to read every row in every table in the document to search for an identical entry (excluding Col 1 as this is unique).
Sorry but your description here is a little confusing. In what you refer to as Column 3 has repeated entries "Performed By" and "Date". I assuming that the individual tasks as indicated by the detailed instructions in Column 2 may well be repeated on the same day and or by the same person, just exactly what are you searching for again? Are you trying to proofread the instructions to see if they are being repeated?
Dembones
08-30-2022, 05:47 AM
The text in column 2 and 3 (if col 3 exists) is repeated later in the document. I want to colour code the repeated instances and know the step number is it is more than once.
Dembones
09-05-2022, 03:26 AM
Hi. Are you able to help with this at all? Thanks.
Aussiebear
09-05-2022, 04:49 AM
I must admit I thought Macropod would have been all over this since its a word issue.... maybe a little nudge is in order.
macropod
09-05-2022, 06:36 AM
Sorry, but that document doesn't have
one big table...but for formatting, some are broken across pages with CR
what is has is a plethora of tables split by manual page breaks, with text like 'Step 4 Continued:', inconsistent column layouts - up to 5 of varying widths, in fact - and that's before we even consider nested tables, of which there are many. Even within cells, varying numbers of paragraph breaks are used to force a bottom alignment instead of using Word's table cell vertical alignment options.
In other words, from a programming standpoint your document is a dog's breakfast. Coding around all the inconsistencies would require more effort than checking the document manually. Someone really needs to spend some time learning how to do do document layout consistently, using Word's formatting tools instead of hard-formatting things and inserting page breaks, etc. where they aren't needed.
Dembones
09-05-2022, 08:08 AM
OK. Thanks all for looking at it. We'll give up on it.
Aussiebear
09-05-2022, 08:14 AM
Why give up on it? Simply redesign the document
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.