Conditional Formatting help

sachin30us

New Member
Joined
Feb 8, 2012
Messages
14
Hey guys..


I need some help

So sheet 1 has the below data

Cell A2, A3 and A4 have 1, 2, 3 respectively and

Cell B1, C1 and D1 have 2, 3, 4 respectively

I want excel to highlight matching cells in B1, C1 and D1 by searching A1,A2 and A3

Is there a formula or macro that can do that?
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi sachin30us,

This code 'should' match the numbers, then give the matching pairs a random colour...

Code:
Sub MatchGiveRandomColour()
RandNum = Evaluate("RandBetween(0,56)")
LastRw = Range("A" & Rows.Count).End(xlUp).Row
LastCol = Cells(1, Columns.Count).End(xlToLeft).Column

For i = 2 To LastRw
    For x = 2 To LastCol
        If Range("A" & i).Value = Cells(1, x).Value Then
        
            Range("A" & i).Interior.ColorIndex = RandNum
            Cells(1, x).Interior.ColorIndex = RandNum
        
            RandNum = Evaluate("RandBetween(0,56)")
        
        End If
    Next
Next
End Sub

May not be exactly what your after but is a start...

Hope this helps,
Cheers,
Alan.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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