Format a New View?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to create a custom view that would highlight the entire
column and row with the color of my choice when a single cell is selected?
This would sure help my eyes when working on large spreadsheets. I currently
use the freeze panes function but would like this addition as well. Any help
would be greatly appreciated
 
Add the following code to the worksheet module of your choice and assign it
to the worksheets SelectionChange event. However, this will slow things down
a bit as you move about the worksheet.

------------------------------------------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim lngRow As Long
Dim intCol As Integer

lngRow = Target.Row
intCol = Target.Column

Application.ScreenUpdating = False
ActiveSheet.Cells.Interior.ColorIndex = xlNone

Range(Cells(lngRow, 1), Cells(lngRow, 256)). _
Interior.ColorIndex = 3
Range(Cells(1, intCol), Cells(65536, intCol)). _
Interior.ColorIndex = 3

End Sub
 
But be aware that this event code will wipe out any existing background
formatting you may currently have.


Gord Dibben MS Excel MVP
 
Thank you Kevin. I appreciate your help

Kevin B said:
Add the following code to the worksheet module of your choice and assign it
to the worksheets SelectionChange event. However, this will slow things down
a bit as you move about the worksheet.

------------------------------------------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim lngRow As Long
Dim intCol As Integer

lngRow = Target.Row
intCol = Target.Column

Application.ScreenUpdating = False
ActiveSheet.Cells.Interior.ColorIndex = xlNone

Range(Cells(lngRow, 1), Cells(lngRow, 256)). _
Interior.ColorIndex = 3
Range(Cells(1, intCol), Cells(65536, intCol)). _
Interior.ColorIndex = 3

End Sub
 
Back
Top