Conditional Formatting
You may not need a programming solution if you use a DropDownList for Cell B6:
DataValidation
Allow: List
Source: Select the list of Country Names
Click [OK].
Then you could just use Conditional Formatting:
1)Insert a column just before the Country Names.
We'll start with Hong Kong, which was entered in Cell M2, but is now in Cell
N2.
2)In Cell M2, type this formula:
=$B$6=N2
Note: if Cell B6 contains "Hong Kong", the formula will return TRUE.
3)Now copy that formula down the cells in front of each Country Name.
4)Select the list of Country Names (and any other cells you want colored).
5)FormatConditional Formatting.
6)Click the drop-down list and select "Formula Is".
7)Enter this in the Formula Box:
=$M2=TRUE
8)Click the [Format] button and select the fill color you want for the cells.
9)Click the OK button and you're done!
Now, the whenever the country named in Cell B6 changes, the associated cells
in your list will change color and the previously colored cells will revert
back to their default.
Does that help?
Regards,
Ron
|