Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default change current cell colour based on the value of adjacent cell on other worksheet

I am currently working on one complicated excel spreadsheet. I wish to
change current cell colour based on the value of adjacent cell on other
worksheet. In simple words I have 2 worksheets. On worksheet 1 to
monitor the project status I am using conditional formatting. for
example if value of cell A1 is equal to Completed then cell colour
changes to GREEN if it's Hold then RED and if Progressing then
YELLOW. This is standard !!!

Now on 2nd worksheet I wish to monitor the value of the cell A1 on
worksheet 1 and if value changes from blank to Completed , Hold or
Progressing then I wish to change the colour of the cell B1 on
worksheet 2.

Is it possible to achieve this in Microsoft Excel? I will appreciate
if someone tell me how to do this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default change current cell colour based on the value of adjacent cell on other worksheet

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Worksheets("Sheet2")
Select Case Target.Value
Case "Completed":
.Range(Target.Offset(0,1).Address(False,
False)).Interior.ColorIndex = 3
Case "Hold":
.Range(Target.Offset(0,1).Address(False,
False)).Interior.ColorIndex = 5
Case "Pending":
.Range(Target.Offset(0,1).Address(False,
False)).Interior.ColorIndex = 6
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


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Rits" wrote in message
ups.com...
I am currently working on one complicated excel spreadsheet. I wish to
change current cell colour based on the value of adjacent cell on other
worksheet. In simple words I have 2 worksheets. On worksheet 1 to
monitor the project status I am using conditional formatting. for
example if value of cell A1 is equal to Completed then cell colour
changes to GREEN if it's Hold then RED and if Progressing then
YELLOW. This is standard !!!

Now on 2nd worksheet I wish to monitor the value of the cell A1 on
worksheet 1 and if value changes from blank to Completed , Hold or
Progressing then I wish to change the colour of the cell B1 on
worksheet 2.

Is it possible to achieve this in Microsoft Excel? I will appreciate
if someone tell me how to do this?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default change current cell colour based on the value of adjacent cell on

Conditional formatting will not operate across worksheets. The usual
approach is to use a link..If you want to monitor celll A1 on Sheet1, then on
Sheet2 in any cell, say Z100, put a link to the Sheet1 cell and use Z100 for
the conditional formatting reference.
--
Gary's Student


"Rits" wrote:

I am currently working on one complicated excel spreadsheet. I wish to
change current cell colour based on the value of adjacent cell on other
worksheet. In simple words I have 2 worksheets. On worksheet 1 to
monitor the project status I am using conditional formatting. for
example if value of cell A1 is equal to Completed then cell colour
changes to GREEN if it's Hold then RED and if Progressing then
YELLOW. This is standard !!!

Now on 2nd worksheet I wish to monitor the value of the cell A1 on
worksheet 1 and if value changes from blank to Completed , Hold or
Progressing then I wish to change the colour of the cell B1 on
worksheet 2.

Is it possible to achieve this in Microsoft Excel? I will appreciate
if someone tell me how to do this?


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
Using CF to change colour in cell based on date? Steve[_26_] Excel Discussion (Misc queries) 4 March 21st 10 10:52 PM
how do i change cell text colour based on value in other cell Oscarrot Excel Worksheet Functions 2 July 20th 09 03:21 PM
Saving current worksheet on cell value change scotty New Users to Excel 1 January 23rd 07 03:29 PM
How to change cell colour based on numer of months? Tiago Excel Programming 6 May 11th 06 01:20 PM
Change the colour of a bunch of cells, based on one cell. Craig & Co. Excel Programming 2 October 14th 04 06:28 AM


All times are GMT +1. The time now is 12:42 PM.

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

About Us

"It's about Microsoft Excel"