How to Automatically Highlight the Active Row and Column in Microsoft Excel

Navigating massive spreadsheets spanning dozens of columns and hundreds of rows often causes eye fatigue. When reviewing a specific transaction in column R on row 428, glancing back to column A to confirm the client name or looking up to row 1 to read the header can easily lead to reading the wrong row. While Excel lets you freeze panes, having an automated visual crosshair that highlights the active row and column as you click across cells provides immediate clarity.

By pairing native CELL formulas in Conditional Formatting with a short one-line VBA event trigger, you can build a dynamic, non-destructive crosshair highlighter in Microsoft Excel.

Step 1: Understanding the CELL Function Formula

Excel includes an informational function called CELL that returns coordinate metrics regarding formatting, location, and contents of a cell. Specifically:

  • CELL("row") returns the row number of the currently active cell.
  • CELL("col") returns the column number of the currently active cell.

When evaluated inside Conditional Formatting, Excel compares each cell’s row and column position against the active selection coordinates.

Step 2: Applying the Crosshair Conditional Formatting Rule

To configure the visual highlight across your primary dataset:

  1. Highlight the data range you wish to illuminate (for example, cells A2:M100).
  2. On the Home tab of the Excel ribbon, click Conditional Formatting → New Rule.
  3. In the rule type list, choose Use a formula to determine which cells to format.
  4. In the formula input box, enter the following formula to highlight both the entire active row and the active column simultaneously:
=OR(ROW()=CELL("row"), COLUMN()=CELL("col"))
  1. Alternative (Row highlight only): If you only want to highlight the active row without the vertical column strip, use: =ROW()=CELL("row").
  2. Click the Format… button.
  3. Navigate to the Fill tab and select a subtle, light tint (such as soft yellow or pastel light blue) that will not obscure text readability.
  4. Click OK twice to confirm the rule.

Step 3: Enabling Instant Screen Refresh with VBA

By default, Excel only recalculates volatile functions (like CELL) when a value changes or when you press F9. To force Excel to update the crosshair instantaneously whenever you click a new cell with your mouse:

  1. Right-click the worksheet tab at the bottom of your Excel window and select View Code.
  2. The Visual Basic for Applications (VBA) editor opens directly to your worksheet code module.
  3. Paste the following simple one-line subroutine into the window:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Target.Calculate
End Sub
  1. Close the VBA editor window.
  2. Click on any cell in your worksheet. The active row and column immediately light up in your chosen pastel colour, moving effortlessly as you navigate with arrow keys or mouse clicks.

Saving the Workbook Properly

Because the workbook now contains a lightweight selection event, save the file as an Excel Macro-Enabled Workbook (.xlsm) via File → Save As to ensure the automatic screen calculation remains active for future sessions.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.