![]() ![]() ![]() Set y = ws. 'Optionally delete any existing conditional formats Just add this to your ThisWorkbook code: Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)Īnd run the following code only once, to create the conditional format rules: Sub CreateConditionalFormats() Office Tools downloads - Kutools for Excel by ExtendOffice and many more programs are available for instant and free download. ' This is optional formatting to make the cells look more like they're actually selectedĬitations: The simple solution is based off of an answer by The complex solution was brought together from many sources, especially with the help of in this post.Ī very simple way of doing this is with conditional formatting and VBA. Download kutools for excel 2016 for free. In ThisWorkbook: Private Sub Workbook_Deactivate() ![]() In the sheet(s) you want it to work in: Private Sub Worksheet_SelectionChange(ByVal Target As Range) = RGB(204, 204, 204)Ī Complex Solution that only changes the cell color when focus is lost A Simple Solution that places a cell color when the selection changes Private Sub Worksheet_SelectionChange(ByVal Target As Range) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |