Cursor and selection invisible when focus is lost

One workaround is described in this post, which does not require usage of VBA/macros:

Copying content to the clipboard will put a dashed border around the highlighted cells, which will still remain when the Excel windows loses focus.

Highlight the concerned row by clicking the row number to the left of the row, then click Ctrl-C / Cmd-C.


That is a normal behavior for Windows. It is not specific to Excel. The same thing happens if you select text in Word, then change windows. It can not be turned off.

If you are willing to add macros to your workbook, there is a work-around to highlight the row you need, then remove it when you are done. The highlighted row will show when the window does not have focus.

Add these pieces of code in the VBA Explorer (Alt+F11) to ThisWorkbook and you can either call them from macros (Alt+F8) or add buttons for them.

Sub RowHighlight()
  Rows(ActiveCell.Row).Select
  With Selection.Interior
    .Pattern = xlSolid
    .ColorIndex = 6  'Change this number to the color of choice.
  End With
End Sub

Sub RemHighlight()
  Rows(ActiveCell.Row).Select
  With Selection.Interior
    .Pattern = xlNone
  End With
End Sub

Below is an index of colors you can change in the code. Currently set to Yellow.

enter image description here