If a word in a range then check the left word of this word

frankrss

New Member
Joined
Nov 28, 2009
Messages
31
Hi, I would like to use Macro to check a word whether it is in a range, if it is in a range, then to check the left word of this word.
For example:

The range in Excel is:
NameAge
Ingrid30
Peter20
Hans18
Jan35

<tbody>
</tbody>


The texts in my MS Word are :
45 Jan, 30 Ingrid 18 Hans and 30 Peter.
How can I use Macro in Word to Check the range in Excel whether the age is correct or not?

In this example the age of Jan and Peter are not right. Because Jan is 35 and Peter is 20.

Thanks
Frank
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
How many names are in your lookup list with the correct data currently in your excel range
 
Upvote 0
My logica is;

1. First it will check the words in MS word (a loop), if a word is in the list of Excel (mabye via Array), it will find the left word of it and it will use VLookup to see whether the left word is the same as in Excel.
2. If it is not the same it will pop up a message to let the user to replace it or not.
 
Upvote 0
500 unique names and ages ?? Or is this the number of names in your word document, what happens when you have two peters with different ages in your excel list
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top