selected cells doesnot change colour

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

Guest

I want the excel cells to change colour as I select so I could see the range
I have selected as it was in previous versions. How I can select this option.
 
This is worksheet code so right-click the sheet tab and paste in

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static lastcell As Range
Target.Interior.ColorIndex = 3 'modify to suit
lastcell.Interior.ColorIndex = xlColorIndexNone
Set lastcell = Target
End Sub

Mike
 
sorry forgot a line, try this one:-

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Static lastcell As Range
Target.Interior.ColorIndex = 3 'modify to suit
lastcell.Interior.ColorIndex = xlColorIndexNone
Set lastcell = Target
End Sub


Mike
 
Thanks Mike,
Do I need to remember this code
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Static lastcell As Range
Target.Interior.ColorIndex = 3 'modify to suit
lastcell.Interior.ColorIndex = xlColorIndexNone
Set lastcell = Target
End Sub

to paste every time I open a workbook. Is there any permanent fix for this?
 
Mike!
After this code I am loosing colours if I click mouse in my colums which
have different colour ranges.
I need the options to be set permanently in the excel as it was before in my
Office Xp edition. I think probably this is not included in this Office 2007
edition.
 
Right click sheet tab>view code>insert this>for entire row, uncomment

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
With Target '.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 20
End With
End Sub
 
Thanks Don, but it didn't worked.
When I select rows and columns in Excel, the selected cells are too feint to
see clearly (much darker in previous releases). Is there a way of darkening
the default selected cells shading? I'm not referring to Fill colours and
patters - just the colour/shading used when cells are selected, and want
this setting as default for all my workbooks and new Excel files. Thanks
 
Back
Top