PDA

View Full Version : [SOLVED:] Text link to change table cell colour in Word?



Samphy
02-15-2020, 03:39 AM
Hi all,

I'm not a programmer, but enjoy making documents with pizazz by copying your code! :)

I'm making an evaluation form with lots of rows in standard tables within a Word document. Each row has the following scores 1 - Poor, 2 - Fair, 3 - Good, 4 - Very good, 5 - Excellent. I would like to make it so that the user can click on either the word or score (or both) to select the score at which point the background colour of the cell changes to indicate it has been selected.

Is this possible?

Thanks for your help!
Sam.

gmaxey
02-15-2020, 05:27 AM
Yes, however "clicking on the word or score" is a bit ambiguous. You could use the the WindowsSelectionChange event to see if you click in a cell and then see what that cells value is, or if you clicked in a Word what the words.range.text was. Seems it would make more sense to have a dropdown with the values then evaluate what was chosen in the dropdown.

macropod
02-15-2020, 01:12 PM
See, for example: https://www.msofficeforums.com/word-vba/16505-change-color-according-dropdown-selection.html#post47254