Link to home
Start Free TrialLog in
Avatar of Robert Berke
Robert BerkeFlag for United States of America

asked on

How to improve selected cells shading in excel 2007

On excel 2003, selected cells have a blue shading that is easy to see.  This is especially useful with scattered selections (using control key)

In excel 2007 selected cells are a very light grey which is difficult to see on most monitors, and impossible to see on a lenovo t61 lcd.
i have tried the excel optional color schemes of blue, silver and black, but they do not change the selected cell shading.

I have actually resorted to turning the entire worksheet to yellow.  This makes selected cells stand out much better.  But, it is not an ideal solution for obvious reasons.

We are running both excels under windows xp pro.

rberke
ASKER CERTIFIED SOLUTION
Avatar of Sean Strickland
Sean Strickland
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robert Berke

ASKER

"how much good it would be"? Your idea is interesting, and would work if the problem only occured in one or two heavily used sheets.

But, as you can imagine, this is a problem with every worksheet that the user opens.

My "solution" was to give the user a keyboard and an external monitor (in this case a hanssg 19" widescreen but other monitors would probably be ok)

On the Hannsg  the contrast was still bad, but a lot better than nothing.  Maybe this is Microsoft's way of encouraging people to stop using laptops?

Also, several "company wide" macros like "select duplicates" end with code like "myRange.select".  I changed a few of them to also say MyRange.copy. This highlights the selected areas with "chase lights".  That helped a little.

I will leave this problem open for a few days in hopes that someone comes up with a better idea, then I will close it and award points to all who participate.




Yeah, it's not a very practical solution, but it would serve it's purpose if your company never highlighted cells in excel. :)


However, take a look at what I've found for you.  This code will keep the original formatting (highlighted cells, etc).  This is pretty useful!

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
With Target
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
End Sub

Open in new window

Also, to place the code in the entire workbook (so you enter it once per spreadsheet that you have), go to the VBA Screen (Alt+F11 from Excel), and open your ThisWorkbook module (should be located in the frame on the left).  Enter this code into it:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Cells.FormatConditions.Delete
With Target
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
End Sub

Open in new window

That is really cute.  It sort of works as long as you don't want to ruin conditional formatting and as long as you never want to copy ranges from one place to another.

The following would not highlight if conditional formatting existed, or if the clipboard has something on it.  It would be nice if the dataobj.gettext was changed to only exit when a range was on the clipboard, but I don't know how to do that.

But, in all honesty, there is not chance I will use any of these techniques in real life.  They are way too temperamental.
The only viable solution is to use a different monitor.



Option Explicit
Dim previousWorksheet As Worksheet
Dim previousRange As Range
 
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Column = 1 Then Exit Sub
 
If Not previousWorksheet Is Nothing Then
    previousWorksheet.Range(previousRange.Address).FormatConditions.Delete
    Set previousWorksheet = Nothing
    Set previousRange = Nothing
End If
On Error Resume Next
Dim MyDataObj As New DataObject, myDummy As Variant
    Set myDummy = Nothing
    MyDataObj.GetFromClipboard
    myDummy = MyDataObj.GetText
    
    If Err = 0 Then Exit Sub
    Err.Clear
 
        With Target
        .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
        If Err = 0 Then
            .FormatConditions(1).Interior.ColorIndex = 35
            Set previousWorksheet = Target.Worksheet
            Set previousRange = Target
        End If
 
On Error GoTo 0
End With
End Sub

Open in new window

delete line 6 in the above snippet.
Here is a REAL solution.  There might be simpler ways to do it, but this works on XP.

PROBLEM: in excel 2007 "selected cells" do not appear with very much contrast. On some monitors they are impossible to see.

SOLUTION under Windows XP:
find the name of your current wallpaper background which can be found by right clicking on desktop > properties > desktop > background.  Write down the name, you will need it in a few minutes.

open control panel > accessibility options > display > 
turn on "use high contrast"  > apply  

DON'T PANIC. Windows will tell you to wait. then a minute later your screen will look AWFUL. To get it back to "nearly normal" do the following.

Right click on desktop > properties > themes >
Change theme from Windows XP (modified) to Windows XP > apply
also, change your wallpaper back to its original setting.

You are now in a "nearly normal" mode where most of the high contrast options are turned off. But, Excel 2007 will have a high contract for selected cells.

To return to "completely normal" : control panel > accessiblity options > display > remove the checkbox from "use high contrast"


Just a note on this:

I had the same problem.  The way I fixed it (like someone above mentioned) was to change the monitor and update software.
fixermonkey:  Does your new monitor have really good contrast?  If not, you might try the solution in my 3/3/2008 posting.  I would expect the contrast would become great.