Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
home_server:mswindows_notes [2025-03-18 Tue wk12 16:54] – [MSExcel Tips] baumkphome_server:mswindows_notes [2025-03-18 Tue wk12 17:10] (current) – [MS Excel Highlight Row or Column] baumkp
Line 220: Line 220:
  
 =====MS Excel Highlight Row or Column===== =====MS Excel Highlight Row or Column=====
-<code basic>The basic built in way :+The basic built in way :
   * ''shift+space'' to highlight the row   * ''shift+space'' to highlight the row
   * ''ctrl+space'' to highlight the column   * ''ctrl+space'' to highlight the column
Line 227: Line 227:
  
 Use a VB macro.  Main down side to this is that it slows down the MSExcel performance Use a VB macro.  Main down side to this is that it slows down the MSExcel performance
 +++++VB Code 1|
 +<code>
 +'from https://www.exceldemy.com/learn-excel/highlight/row/
 +Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 +  If Target.Cells.Count > 1 Then Exit Sub
 +  Application.ScreenUpdating = False 
 +
 +  'Clear the color of all cells
 +  Cells.Interior.ColorIndex = 0
 +  With Target
 +    'Highlight row and column of the selected cell
 +    .EntireRow.Interior.ColorIndex = 38  'or use RGB(200,200,200) to pick a colour
 +    .EntireColumn.Interior.ColorIndex = 24
 +  End With
 +
 +  Application.ScreenUpdating = True
 +End Sub</code>
 +++++
 +
 +++++VB Code 2|
 +<code>'from https://www.howtoexcel.org/highlight-current-row-column/
 Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
 Static xRow Static xRow
Line 251: Line 272:
 End With End With
 End Sub</code> End Sub</code>
 +++++
  
 =====Text to Column===== =====Text to Column=====