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


What you also have to remember is if you are using conditional
formatting to colour L5, Q5 and V5 then this will not be picked up by
the code given.

Ra;374917 Wrote:
Jacob

Many thanks for your help. I have placed the macro under module1,
however,
even though the cells are green (?) I obtain a red in cell AD5 with a
zero.
Just one point the green cells for L5, Q5, V5 are generated using
conditional
formatting. I am not sure if this is a bright green (4). Perhaps, this
is
what is generating the red in cell AD5. How can I find out if I am
using the
right colour?

Thank you.

"Jacob Skaria" wrote:

You will have to make use of VBA to acheive this...Right click on the
sheetView and paste the below code. If you are new to macros set the
Security level to low/medium in (Tools|Macro|Security).

The color referred here is 'Bright Green'. Change the color index as

needed.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Range("L5").Interior.ColorIndex = 4 And _
Range("Q5").Interior.ColorIndex = 4 And _
Range("V5").Interior.ColorIndex = 4 Then
Range("AD5").Interior.ColorIndex = 4
Range("AD5") = 1
Else
Range("AD5").Interior.ColorIndex = 3
Range("AD5") = 0
End If
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Ra" 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,



--
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