Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-07-2023, 06:46 PM
bblelli bblelli is offline Find a text that's equal to "HELLO" in a table cell and copy the left side content. Windows 10 Find a text that's equal to "HELLO" in a table cell and copy the left side content. Office 2021
Novice
Find a text that's equal to "HELLO" in a table cell and copy the left side content.
 
Join Date: Feb 2023
Posts: 22
bblelli is on a distinguished road
Angry 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
Attached Files
File Type: docx Sample.docx (27.6 KB, 5 views)
Reply With Quote
 

Tags
cells, copy, table



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find a text that's equal to "HELLO" in a table cell and copy the left side content. Underlined Purple Text and "formatted" boxes at side of document SeanCGR Word 1 06-20-2014 06:49 AM
How to edit the "Format" and the "show level" of an EXISTING table of content? Jamal NUMAN Word 2 08-14-2011 10:46 AM
Find a text that's equal to "HELLO" in a table cell and copy the left side content. "Table of content" based on "Normal Style" behavior!!!! Jamal NUMAN Word 4 07-08-2011 04:12 AM
Find a text that's equal to "HELLO" in a table cell and copy the left side content. Why the left edge of an inserted table is out "text boundary" by default? Jamal NUMAN Word Tables 2 06-30-2011 04:47 PM
How to have colons (:) in the "Table of content" but to be hidden in the "Heading"? Jamal NUMAN Word 0 06-26-2011 04:53 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:44 AM.


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