View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Highlighting Rows with VB.

This may get you a little closer but does clear some formatting on just the
selected row.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static OldCell As Range
If Application.CutCopyMode = 0 Then
ActiveSheet.Unprotect Password:="justme"
If Not OldCell Is Nothing Then
With OldCell.EntireRow
.Interior.ColorIndex = xlColorIndexNone
.Borders.LineStyle = xlLineStyleNone
End With
End If
Set OldCell = Target
With OldCell.EntireRow
.Interior.ColorIndex = 6
.Borders.LineStyle = xlContinuous
End With
Else
If OldCell Is Nothing Then
Set OldCell = Target
Else
Set OldCell = Union(OldCell, Target)
End If
End If
Me.Range("X:X").ClearFormats
ActiveSheet.Protect Password:="justme"
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Jan 2009 09:59:01 -0800, Xman
wrote:

Hi Susan.....you are right! I had named the sheet something other than
"sheet...." and therfore did not work. You are also right in saying that any
conditions or formats will be eliminated from that column, thus the reason
for the original question, but it's getting closer. Now....if I can just get
those conditions and formats back in there.

Thank you.....