View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim333[_13_] Jim333[_13_] is offline
external usenet poster
 
Posts: 1
Default Coloring a range depending on a cell value


Hi everybody.

I have created the follwoing code to color a specific range when th
value of cell A1 =1 and uncolor it when it is more than 1.

The problem I faced is that when the code is applied the whole shee
becomes un-editable except cell A1, which contains the value.
what I want is to make the whole sheet active and editable afte
applying the follwoing code.


Code
-------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A1").Value = 1 And Target.Address < "$A$1" Then
Range("B2:F2").Select
With Selection.Interior
.ColorIndex = 6
End With
ElseIf Range("A1").Value 1 And Target.Address < "$A$1" Then
Range("B2:F2").Select
With Selection.Interior
.ColorIndex = 0
End With
End If
End Su
-------------------


Thank you for all

--
Jim33
-----------------------------------------------------------------------
Jim333's Profile: http://www.excelforum.com/member.php...nfo&userid=518
View this thread: http://www.excelforum.com/showthread.php?threadid=47330