View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Format a New View?

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


Gord Dibben MS Excel MVP

On Thu, 18 Oct 2007 14:31:04 -0700, Kevin B
wrote:

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
------------------------------------------------------------------------------------------------