Share via

Validate data between two columns

Anonymous
2024-07-11T17:33:03+00:00

Hi,

Is there any macro help to highlight if the value in column not matching with the column next to it.

Example:

Cell A1 has the name "John" and "B1" is the employee ID: 23457. Cell "A5" has Peter and Employee ID 23985 in "B5" In this case if the same name appears anywhere in the same column with different employee ID next to it, can the macro highlight the incorrect rows please?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2024-07-11T18:07:39+00:00

Select A1:A100 (or as far down as necessary). A1 should be the active cell in the selection.

On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula

=OR(ISNUMBER(FIND("™", A1)), ISNUMBER(FIND("©", A1)), ISNUMBER(FIND("®", A1)))

Click Format...

Activate the Fill tab.

Select a fill color.

Click OK, then click OK again.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

3 additional answers

Sort by: Most helpful
  1. HansV 462.6K Reputation points
    2024-07-11T17:58:58+00:00

    Select A1:B100 (or as far down as necessary). A1 should be the active cell in the selection.

    On the Home tab of the ribbon, click Conditional Formatting > New Rule...
    Select 'Use a formula to determine which cells to format'.
    Enter the formula

    =COUNTIFS($A$1:$A$100, $A1, $B$1:$B$100, "<>"&$B1)

    Click Format...
    Activate the Fill tab.
    Select red as fill color.
    Click OK, then click OK again.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-07-12T17:33:24+00:00

    Hi HansV,

    Thankyou so much, this works great👍

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-07-11T17:53:19+00:00

    Also, is there anyway I can find special character like trade mark symbols appears in column A?

    Was this answer helpful?

    0 comments No comments