Find a text that's equal to "HELLO" in a table cell and copy the left side content.
Dears,
I have a Word Document with approximately 1000 tables. Each table may have 1, 2, 3, 4, 5, or even six columns.
I want to create a VBA code that goes through all my Word tables, checking on every cell if there is a specific text ("HELLO") in this sample.
So, on the last page of my Word Document, the macro should create a new table with 4 columns and insert the following information:
Column 1: The Check explained below (1)
Column 2: The entire text of the left side cell.
Column 3: The page header where the text "HELLO" was found
Column 4: The page number where the text "HELLO" was found
(1) The check: Whenever the text "HELLO" is found, the macro should check the content of the left side cell. If the left side cell's text contains the word "APPLE" the code should populate column 1 with the text "I LIKE APPLES". If the left side cell's text contains the word "BANANA", then the code should populate column 1 with the text "I DON'T LIKE BANANA"
End, if possible, the text on the Column 2 must be a hyperlink that, if clicked, directs the user to the page where this text came from.
Please, find a sample file attached here!
How can I do that?
Any help is very welcome!
Thanks a lot
|