Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
MysterTLC
 
Posts: n/a
Default How do I shade cells during selection?

I am trying to shade cells only when they are selected unless I specify them
to be shaded all the time. Is this possible?
I am using Excel 2003
  #2   Report Post  
Don Guillett
 
Posts: n/a
Default

try this. Right click sheet tabview codeinsert thisSAVE workbook

'McCurdy.Here is something inspired by Don Guillett.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRng As Range
Set MyRng = Target.EntireRow
Application.EnableEvents = False
On Error GoTo end1
Application.Cells.FormatConditions.Delete
With MyRng
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=ROW()=ROW(INDIRECT(CELL(""address"")))"
With .FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 1
End With
.FormatConditions(1).Interior.ColorIndex = 36
End With
end1:
Application.EnableEvents = True
End Sub

--
Don Guillett
SalesAid Software

"MysterTLC" wrote in message
...
I am trying to shade cells only when they are selected unless I specify

them
to be shaded all the time. Is this possible?
I am using Excel 2003



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why "center across selection" rather than "merge" cells? What is. Michele Excel Discussion (Misc queries) 7 November 5th 08 04:36 AM
random selection from a range of cells tjb Excel Worksheet Functions 1 February 15th 05 06:34 PM
How do I automatically shade cells depending on data entered? Jim Johnson Excel Worksheet Functions 6 October 29th 04 07:01 PM
How do I shade cells using the "IF" function? Kaz Excel Worksheet Functions 3 October 29th 04 02:03 PM
How to shade a row of cells using conditional formatting Frustrated invoicer! Excel Worksheet Functions 4 October 29th 04 08:01 AM


All times are GMT +1. The time now is 01:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"