Marking a cell in a lookup table

dugmick

New Member
Joined
Feb 25, 2012
Messages
4
Good afternoon -

I have a workbook sheet1 that has a column (A) of defective serial numbers and column B which has "NG" in its cells, this is my lookup table. Sheet2 contains a column (K) populated from a barcode scanner, with an adjacent column (L) performing a vlookup to column A in sheet1. If a match is found, it returns the "NG" to the cell in column L adjacent to the the last scanned barcode and I turn the cell red; if no match is found I turn the cell green and label it with an "OK".

I would like to fill the cells in the lookup table (sheet1 column A) with yellow if they matched the scan results, so at the end of the day I can see what numbers are matched and what numbers are not yet matched. I am weak with VBA, what little bit I have added is from trial and error, with a healthy dose of Google results for inspiration.


1630005333888.png





Thanks for looking and for any suggestions!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Conditional formatting will do it. Select values in sheet1 column A, then Conditional Formatting, New Rule, Use Formula.
=ISNUMBER(MATCH(A1,$K$1:$K$(max),0))
This will return TRUE if it exists, set format fill to yellow.
A1 assumes its the active cell in the range selected, adjust if needed.
 
Upvote 0
Conditional formatting will do it. Select values in sheet1 column A, then Conditional Formatting, New Rule, Use Formula.
=ISNUMBER(MATCH(A1,$K$1:$K$(max),0))
This will return TRUE if it exists, set format fill to yellow.
A1 assumes its the active cell in the range selected, adjust if needed.
Thanks for the reply. I realized I didn't add to the original post that at the end of each day, the workbook is copied to a network drive and the original has the cells cleared with that day's results. I believe the conditional formatting would then see no matches, and all of the cells in the lookup sheet would revert back to no fill.
 
Upvote 0

Forum statistics

Threads
1,214,625
Messages
6,120,598
Members
448,973
Latest member
ksonnia

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