View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Simon Lloyd[_255_] Simon Lloyd[_255_] is offline
external usenet poster
 
Posts: 1
Default Using 3 coloured Cells to Format a 4th Cell


Ra;374492 Wrote:
Please can you help me with the following problem:

I have three cells: L5, Q5 and V5, which when I colour green, then I
would
like for cell AD5 to be automatically coloured green and a number 1 be
placed
in it.

If on the other hand cells L5, Q5, V5 are any other colour, then cell
AD5
should be coloured red and a zero to be placed in it.

Please can you help me to devise a method of doing this.

Many thanks for your help and support,Perhaps you could use a macro in the worksheet code module like this:


Code:
--------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Me.Range("L5").Interior.ColorIndex = 4 And _
Me.Range("Q5").Interior.ColorIndex = 4 And _
Me.Range("V5").Interior.ColorIndex = 4 Then
With Me.Range("AD5")
.Interior.ColorIndex = 4
.Value = 0
End With
End If
End Sub
--------------------




*How to Save a Worksheet Event Macro*
1. *Copy* the macro using *CTRL+C* keys.
2. Open your Workbook and *Right Click* on the *Worksheet's Name Tab*
for the Worksheet the macro will run on.
3. *Left Click* on *View Code* in the pop up menu.
4. *Paste* the macro code using *CTRL+V*
5. Make any custom changes to the macro if needed at this time.
6. *Save* the macro in your Workbook using *CTRL+S*


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=104819