VBA - Lookup and then execute conditional format for selected cells.

LittleJon

New Member
Joined
Oct 14, 2018
Messages
18
Is it possible to look up a cells text, then check in a range and if there is a match highlight certain cells/rows

https://ibb.co/XyPkXDw

Lets say on the link that in the header "Country" is A1.

Currently using conditional formatting you can see some of the countries listed are highlighted, this is because they match the same country name in a range which starts from A100.

What i would like is for the code/formula to highlight A3:F3 if A3 matches a name in the range. Please note that the country name in A2, A3 etc can vary from day to day, but the color will always remain the same.

I've tried so many different type of formulas and codes for this, but to no avail. Any help would be appreciated.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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