Color related cells when hovering above

BramGrey

New Member
Joined
Jan 6, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Good day,

I have a table with several names of drivers under each other (imagine from A1 till A100). Next to that a table with on the top the days of the wee, and every drivers name on a specific day (example attached).

Is there a possibility when I hover over a name on the left side (if possible over every name of the driver, also on the calendar), this and all other cells on the page, colours in the same colour, so just by hovering over it. Just to make it clear when who is driving

EXAMPLE attached.
So when I hover over "Anita", on the right side all cells which contain "Anita" will light up.

Thanks!
 

Attachments

  • Schermafbeelding 2023-01-06 132113.png
    Schermafbeelding 2023-01-06 132113.png
    13.1 KB · Views: 5

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
There is not a cell hover event but have a look at this here.

You could use the Worksheet_SelectionChange event to run code when you select the call with the name in it.
Write the name in the cell selected to another cell and use conditional formatting.
 
Upvote 0
Solution
You can instead use the arrow keys to select the cell in column 1 and it will work
Double click the sheet in vba editor > select general and flip it to worksheet > on the right drop down menu select selection change and paste this

VBA Code:
'Private Sub Worksheet_SelectionChange(ByVal Target As Range)
            
            Range("C1").CurrentRegion.ClearFormats

            If Intersect(Target, Range("A:A")) Is Nothing = False Then
            lr = Range("C1").CurrentRegion.Rows.Count
            lc = Range("C1").End(xlToRight).Column

                    For k = 2 To lr
                            For j = 3 To lc
                             If Cells(k, j).Value = Target.Value Then
                                Cells(k, j).Interior.Color = vbYellow
                            End If
                            Next j
                    Next k

            End If

'End Sub
 

Attachments

  • 1673018342936.png
    1673018342936.png
    26.5 KB · Views: 5
Upvote 0

Forum statistics

Threads
1,215,438
Messages
6,124,875
Members
449,192
Latest member
MoonDancer

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