PDA

View Full Version : Table cells comparison automation in MS Word



Thatsme
11-18-2010, 12:20 PM
Hi,
The problem is as follows:
- I have a table in MS Word with 4 columns. I want the code to make automatically the following : I insert a text (Text 1) in Col 2, Row 2 (let's say). :Then I insert a text (Text 2) in Col 4, Row 2 (same row). If the two texts are the same (no matter the case) the color of Text 2 remain black. If Text 2 is different from Text 1, the color of Text 2 changes to Red . Then I go to the next row (or I insert a new one). The code must do the same thing until I close the App.You knopw, like in Autocorrect when the text is change. Can you help me ?

Thank you for your time.
Thatsme

fumei
11-18-2010, 12:23 PM
If YOU are inserting the text - Text 1 and Text 2 - would you not know already if they are the same?

As for this acting like an AutoCorrect. sorry, no.

Thatsme
11-18-2010, 12:30 PM
Suppose the two texts differ with one letter. (for example : Text1 = "letter" and Text2 = "leter" and suppose that that two words are in the context of a large statement. That's the problem.

Thatsme.

fumei
11-18-2010, 01:08 PM
But again, you are stating that YOU are entering the text. What is the need for any automation? Or are you getting the text from somewhere via code? if so, say so.

As it stand it seems you are stating:

I enter "letter" in one cell. I enter "leter" in a different cell. How do I find out if "leter" is different from "letter".

1. look
2. use AutoCorrect so "leter" is changed to "letter"

I have no idea what you mean by: "in the context of a large statement."

You have to actually tell us the situation. We can not read minds.

You state single words (letter vs leter) then make a comment about large statement. Not a clue.

Thatsme
11-18-2010, 09:33 PM
Sorry, my fault. Ok. I enter some numbers in the two cells. They can differ or not. It is difficult to make the comparison because the numbers are on the same row but the columns are far from each other. So when I enter the second number I want to change the color if it is different. Thank you for your time.

Thatsme

fumei
11-19-2010, 10:07 AM
And you want this to be real-time, yes? I am having problems envisioning a WORD table so large that the distance between cells on the same row is an issue.

So. You type "blah" in cell 2, and "blaah" in cell 413 (since each cell is only one character wide). You want Word to know, that if you type ANYTHING in cell 413, then automatically go look at cell 2 and check to see if they are different.

Sorry. No. You could have a procedure that you fire by a hotkey, or an icon, or a menu. But automatically, like an AutoCorrect (but VERY different as you are making a test comparision to a different string of text)? Nope.

So can you do it? Yes. Can you have it automatic? No.

I still do not see what the problem is. You can still see the row, yes. It is after all still on the same page. Rows do not break pages, and it IS on the same row.

So look at it and see if they are different. OR, make a macro that actually does test and make it a keyboard shortcut.

Still do not see anything relevant about a "large statement".

"It is difficult to make the comparison because the numbers are on the same row but the columns are far from each other. "

far from each other. Really?

You originally wrote: " I have a table in MS Word with 4 columns."

I have a hard time seeing cells in a 4 column table being far from each other.

Thatsme
11-19-2010, 11:21 AM
Hi,
Thank you. This is what I wanted to know : automatic, nope. Hotkey, icon, menu item is OK. I wrote the code; I was interested in an automatic approach. By the way : the 4 cols table was just an example.
Bye,
Thatsme (Eugen)