Highlight cell by selecting it

%3CLINGO-SUB%20id%3D%22lingo-sub-2422185%22%20slang%3D%22en-US%22%3EHighlight%20cell%20by%20selecting%20it%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2422185%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20highlight%20a%20cell%20by%20just%20slicking%20on%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2422185%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2422222%22%20slang%3D%22en-US%22%3ERe%3A%20Highlight%20cell%20by%20selecting%20it%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2422222%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1072884%22%20target%3D%22_blank%22%3E%40BdiveleyHSP%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESee%20for%20example%20%3CA%20href%3D%22https%3A%2F%2Fwww.extendoffice.com%2Fdocuments%2Fexcel%2F2129-excel-highlight-active-cell.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EHow%20to%20highlight%20active%20cell%20or%20selection%20in%20Excel%3F%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20read%20the%20notes%20to%20learn%20about%20the%20side%20effects.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2423056%22%20slang%3D%22en-US%22%3ERe%3A%20Highlight%20cell%20by%20selecting%20it%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2423056%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHi%20Peter%2C%3C%2FP%3E%0A%3CP%3EThanks%20-%20I%20am%20familiar%20with%20this%20method%2C%20but%20it%20has%20been%20less%20than%20100%25%20dependable%20in%20my%20experience.%20I%20have%20tried%20it%20several%20times%2C%20but%20it%20occasionally%20left%20cells%20highlighted%20after%20another%20cell%20had%20been%20selected...%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Is there a way to highlight a cell by just slicking on it?

4 Replies

@BdiveleyHSP 

See for example How to highlight active cell or selection in Excel? 

Please read the notes to learn about the side effects.

@Hans Vogelaar 

Another option is to use conditional formatting rather than an interior fill.  By defining the name 'isSelected?' to refer to

= ISREF(Sheet1!H15  SelectedRange)

[the intersection of the current cell as a relative reference and a range set by the Macro]

one can colour cells using leaving the interior fill unaltered.

 

image.png

The macro is 

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  Target.Name = "SelectedRange"
End Sub

@Peter Bartholomew 

Hi Peter,

Thanks - I am familiar with this method, but it has been less than 100% dependable in my experience. I have tried it several times, but it occasionally left cells highlighted after another cell had been selected...

Fair enough. It was just an idea that seemed to work on the day, not something I have used to any extent. Naming the Target range seems to be robust but conditional formatting itself seems antiquated and fragile. Something I would like to do is to apply a CF to a named range and have the CF adjust dynamically, also to use an array formula to set the conditional format, rather than it simply using the top-left cell.

Since I use drag and drop as a routine part of building solutions, working with relative referencing is painful.