How to keep selected text highlighted when focus changes in Microsoft Word/Excel

A quick way to fix half of your problem (when switching from Excel to Word) is to copy the text. When you hit Ctrl + c the cells will continue to be marked (the highligthing is gone, but you still have a dotted line around the text).

A downside to this, is that the text are only marked, as long as you hold the cells copied. Meaning you can't copy anything else or the marking is gone. Unfortunately this will not work from Word to Excel.


This seems to be an exclusive Microsoft "feature". For most projects I only need read-only access and formatting doesn't matter in my case, therefore I have switched to OpenOffice which does not exhibit this behavior.


there is no permanent solution to this problem.

a workaround (may get annoying in a while) would be to change the highlighting of the selected cells while they are selected and re-select them again to drop the color.

Stick this code in Sheet1 code behind and go to you spreadsheet and select some cells, select other ones then re-select the first ones to drop the color

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim cell As Range

    For Each cell In Target.Cells
        If cell.Interior.Color = RGB(60, 150, 230) Then
            cell.Interior.Pattern = xlNone
        Else
            cell.Interior.Color = RGB(60, 150, 230)
        End If
    Next
End Sub