Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
home_server:mswindows_notes [2025-03-18 Tue wk12 17:01] – [MS Excel Highlight Row or Column] baumkphome_server:mswindows_notes [2025-03-18 Tue wk12 17:10] (current) – [MS Excel Highlight Row or Column] baumkp
Line 229: Line 229:
 ++++VB Code 1| ++++VB Code 1|
 <code> <code>
-'from https://www.ablebits.com/office-addins-blog/highlight-active-row-column-excel/+'from https://www.exceldemy.com/learn-excel/highlight/row/
 Private Sub Worksheet_SelectionChange(ByVal Target As Range) Private Sub Worksheet_SelectionChange(ByVal Target As Range)
   If Target.Cells.Count > 1 Then Exit Sub   If Target.Cells.Count > 1 Then Exit Sub
Line 238: Line 238:
   With Target   With Target
     'Highlight row and column of the selected cell     'Highlight row and column of the selected cell
-    .EntireRow.Interior.ColorIndex = 38+    .EntireRow.Interior.ColorIndex = 38  'or use RGB(200,200,200) to pick a colour
     .EntireColumn.Interior.ColorIndex = 24     .EntireColumn.Interior.ColorIndex = 24
   End With   End With