Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default color corresponding cell in other column

Hi experts,

here's my problem:

in column "O" i have words like Closed, quote, Negotiation, Lost
Now, when a cell in column O is changed, I would like to color the
corresponding cell in column D to

closed = green
quote = blue
Negotiation = orange
Lost = red

Do you have any idea how to solve this in VBA please?
Thanks,
Pierre

P.S. conditional formatting does not work beause i need more than three
colors...

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200512/1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default color corresponding cell in other column

Hello Pierre,

Think you shoud take a look at
http://rhdatasolutions.com/ConditionalFormatVBA/

HTH
Cheers
Carim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default color corresponding cell in other column

Hi Pierre,

See xlDynamic's CFPlus page at:

http://www.xldynamic.com/source/xld.....Download.html


---
Regards,
Norman


"Pierre via OfficeKB.com" <u13950@uwe wrote in message
news:5999f8b5421e8@uwe...
Hi experts,

here's my problem:

in column "O" i have words like Closed, quote, Negotiation, Lost
Now, when a cell in column O is changed, I would like to color the
corresponding cell in column D to

closed = green
quote = blue
Negotiation = orange
Lost = red

Do you have any idea how to solve this in VBA please?
Thanks,
Pierre

P.S. conditional formatting does not work beause i need more than three
colors...

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200512/1



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default color corresponding cell in other column

I think that u should use conditional formating. In your case it's possible
to set those formats. Format cells in one column on clasic way and then set
conditions.
Example
set red colour for all cells that are in specified range, and
then in coditional formating set
closed = green
quote = blue
Negotiation = orange

€žPierre via OfficeKB.com€ś je napisao:

Hi experts,

here's my problem:

in column "O" i have words like Closed, quote, Negotiation, Lost
Now, when a cell in column O is changed, I would like to color the
corresponding cell in column D to

closed = green
quote = blue
Negotiation = orange
Lost = red

Do you have any idea how to solve this in VBA please?
Thanks,
Pierre

P.S. conditional formatting does not work beause i need more than three
colors...

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200512/1

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default color corresponding cell in other column

Pierre,

You need more than 3, but only 4. You could set them all to a default
colour, say green for closed, and then use the 3 formats in CF to test for
other values.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pierre via OfficeKB.com" <u13950@uwe wrote in message
news:5999f8b5421e8@uwe...
Hi experts,

here's my problem:

in column "O" i have words like Closed, quote, Negotiation, Lost
Now, when a cell in column O is changed, I would like to color the
corresponding cell in column D to

closed = green
quote = blue
Negotiation = orange
Lost = red

Do you have any idea how to solve this in VBA please?
Thanks,
Pierre

P.S. conditional formatting does not work beause i need more than three
colors...

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200512/1





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default color corresponding cell in other column

Hi bob,

actually, i need more then 4 but listed only 4 in my question...
Please help...
Pierre

Bob Phillips wrote:
Pierre,

You need more than 3, but only 4. You could set them all to a default
colour, say green for closed, and then use the 3 formats in CF to test for
other values.

Hi experts,

[quoted text clipped - 15 lines]
P.S. conditional formatting does not work beause i need more than three
colors...


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200512/1
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default color corresponding cell in other column

You have already been given two solutions that would work, from Norman and
from Carim.

I would use the worksheet event code


Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case "Lost": .Interior.ColorIndex = 3 'red
Case "Negotiation": .Interior.ColorIndex = 46 'orange
Case "quote": .Interior.ColorIndex = 5 'blue
Case "closed": .Interior.ColorIndex = 10 'green
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pierre via OfficeKB.com" <u13950@uwe wrote in message
news:599b361b77fc4@uwe...
Hi bob,

actually, i need more then 4 but listed only 4 in my question...
Please help...
Pierre

Bob Phillips wrote:
Pierre,

You need more than 3, but only 4. You could set them all to a default
colour, say green for closed, and then use the 3 formats in CF to test

for
other values.

Hi experts,

[quoted text clipped - 15 lines]
P.S. conditional formatting does not work beause i need more than three
colors...


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200512/1



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default color corresponding cell in other column

If the changes in column O are by editing the cell, then right click on the
sheet tab and select view code. Paste in code like this:

Private Enum icolor
green = 4
blue = 5
yellow = 6
orange = 45
red = 3
End Enum


Private Sub Worksheet_Change(ByVal Target As Range)
Dim icol As icolor
Dim cell As Range
If Target.Columns.Count = 1 And Target.Column = 15 Then
For Each cell In Target
Select Case LCase(cell.Value)
Case "closed": icol = green
Case "quote": icol = blue
Case "negotiation": icol = orange
Case "lost": icol = red
End Select
Cells(cell.Row, 4).Interior.ColorIndex = icol
Next
End If
End Sub

This assumes xl2000 or later.

--
Regards,
Tom Ogilvy

"Pierre via OfficeKB.com" <u13950@uwe wrote in message
news:599b361b77fc4@uwe...
Hi bob,

actually, i need more then 4 but listed only 4 in my question...
Please help...
Pierre

Bob Phillips wrote:
Pierre,

You need more than 3, but only 4. You could set them all to a default
colour, say green for closed, and then use the 3 formats in CF to test

for
other values.

Hi experts,

[quoted text clipped - 15 lines]
P.S. conditional formatting does not work beause i need more than three
colors...


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200512/1



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
Sum Column Based on Cell Color Thomas M.[_3_] Excel Worksheet Functions 6 April 5th 23 02:42 PM
Average of cells in a column if the top cell is a color Ana[_2_] Excel Worksheet Functions 3 November 29th 11 10:10 PM
Use color for delete column or cell icons karrenb Setting up and Configuration of Excel 0 August 3rd 05 02:35 AM
How do I change the color of the indicator cell in row and column Jim the Estimator Excel Worksheet Functions 1 July 27th 05 12:31 PM
Change Whole Column Cell Color Nigel Bennett Excel Programming 4 March 14th 05 04:37 PM


All times are GMT +1. The time now is 09:46 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"