View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
RobN[_2_] RobN[_2_] is offline
external usenet poster
 
Posts: 230
Default Change default fill color of selected cells?

Try this code, below, ( right click the sheet and select view code, and
paste it there). You will have to fiddle with the ColorIndex number shown
here as 35 until you get the colour you want. I think the number range goes
to about 50 or so.
You may want to delete this part......
"If Target.Cells.Count 1 Then Exit Sub" part if it's not what you want,
( this part stops the procedure if more than one cell is selected at one
time.)
You may also want to alter the Range which I've set to A1:Z100

Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim wkArea As Range
Set wkArea = Range("A1:Z100")
If Target.Cells.Count 1 Then Exit Sub
With wkArea.Interior
.ColorIndex = 0
End With
With ActiveCell.Interior
.ColorIndex = 35
End With
End Sub

Rob

"Stan" <we@there wrote in message
...
Thanks, but that means I must do that sequence after I select cells.
What I need is a default (darker) color as cells are selected.
"JLGWhiz" wrote in message
...
One way is FormatCellsPatterns then select from the color palette and
click
OK.

"Stan" wrote:

How do I change the default fill color of selected cells, which is
normally
very pale?
Office 2007, Win XP Pro