Active Cell Color

  • Thread starter Thread starter Taurien
  • Start date Start date
T

Taurien

Hi!

Any function by which we can have active cell as colored or defferent from
other cells as usually we have to look at the row and column on top as its
highlighted. So any function by which a cell is colored.

Regards
 
Chip Pearson has a utility on his site that does what you want.
www.cpearson.com

Unfortunately, his site appears to be down at this moment. If you check it
in a little while it might be back on line
 
Chip's rowliner is probably your best bet but it won't work on protected
worksheets.

This sheet event code is similar and can work on a protected sheet.

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
OldCell.Interior.ColorIndex = xlColorIndexNone
OldCell.Borders.LineStyle = xlLineStyleNone
End If
Set OldCell = Target
OldCell.Interior.ColorIndex = 6
OldCell.Borders.LineStyle = xlContinuous
Else
If OldCell Is Nothing Then
Set OldCell = Target
Else
Set OldCell = Union(OldCell, Target)
End If
End If
ActiveSheet.Protect Password:="justme"
End Sub

Will color the activecell yellow.

Note: will wipe out existing background color of activecell cell unless BG
color is due to CF


Gord Dibben MS Excel MVP
 
Back
Top