If you are like me and you have to look at a lot of spreadsheets with things like lists of inventory, you probably start seeing the cells dance as you try to track across the row. Is that just me? Maybe it is a touch of dyslexia.
I asked AI to help me find a solution and my AI buddy delivered. Thank you AI overlord ❤️
Here is a simple VBA code snippet that you can use to highlight the row of the active cell:
- Press Alt + F11 to open the VBA editor.
- In the VBA editor, find your workbook in the Project Explorer window.
- Double-click on ThisWorkbook to open the code window for the workbook.
- Copy and paste the following code into the code window:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)Dim ws As WorksheetSet ws = Sh' Clear previous highlightsws.Rows.Interior.ColorIndex = xlNone' Highlight the active rowws.Rows(Target.Row).Interior.Color = RGB(255, 255, 0) ' Yellow colorEnd Sub
5. Close the VBA editor and save your workbook as a macro-enabled workbook (.xlsm).
Now, This code will highlight the row of the active cell in yellow. You can change the color by modifying the RGB values.