Highlighting dependant on whats clicked ?

Pauljj

Well-known Member
Joined
Mar 28, 2004
Messages
2,046
In the range of AG7:AG33 I have a list of locations.

I have the same list of locations in a different order in the range AL7:AL33

If for example the user selects cell AG7 which has the location Exeter in it and Exeter appears in AL15, I would want AL15 to be highlighted...does that make sense ????
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi, Try:-
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Rng As Range, Dn As Range
If Intersect(Target, Columns("AG")) Is Nothing Or Target.Count > 1 Then Exit Sub
    Set Rng = Range(Range("AL1"), Range("AL" & Rows.Count).End(xlUp))
        For Each Dn In Rng
            If Dn.Value = Target.Value Then
                Dn.Interior.ColorIndex = 34
            End If
        Next Dn
    End Sub
Regards Mick
 
Upvote 0
This is perfect, thanks for this. Is there any way I can restrict this to only rows 7 to 33 ??
 
Upvote 0
Please ignore as I have just worked my own question out. Thanks for your help
 
Upvote 0

Forum statistics

Threads
1,207,402
Messages
6,078,270
Members
446,324
Latest member
JKamlet

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