View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Colo[_99_] Colo[_99_] is offline
external usenet poster
 
Posts: 1
Default How to change row color when select a cell in this row?

Amolin, SelectionChange event makes this possible as follow.
If you have already colored cell in the wks, need more code.
Please note, this is just a sample code.


Code
-------------------

'Wks Module
Dim preservedRange As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not preservedRange Is Nothing Then
preservedRange.Interior.ColorIndex = xlNone
End If
Target.EntireRow.Cells.Interior.ColorIndex = 10
Set preservedRange = Target.EntireRow
End Sub

-------------------


--
Message posted from http://www.ExcelForum.com