View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
John[_22_] John[_22_] is offline
external usenet poster
 
Posts: 694
Default Color cells that match on two sheet

Thank you both for your help,

My Code:"Revised but not working" I'm missing something

Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet
Dim GV As Range
Dim CT As Range

On Error GoTo ws_exit:

With Worksheets("GlobalView")
GV = .Range("c5:bc9")
End With

With Worksheets("CalcTable")
CT = .Range("Julian") 'Range E3:E133
End With

For Each cell GV.cells
cell = Worksheets("CalcTable").Range("CT")
cell.Interior.ColorIndex = 10
Next cell
End Sub
------------------------
What I'm trying to do is "Color" the cell in Worksheet ("GlobalView") that match
in worksheet ("CalcTable").
Every cell in the range ("GV") in GlobalView is numbered and when a number
appear in the range ("CT") on Worksheet ("Calctable") that match I want the cell
in GlobalView to change color.
Please let me know if you need further information
Regards
John

"John" wrote in message
...
Hi Everyone

Using XL2003
I'm new to programming and this is my first try beside a couple of Userform.
I've got a Vacation Planner on one sheet for 17 People
Second sheet is a global view showing workdays for the year for all 17 people.
Each cell is numbered to match with Julian date in Calctable sheet
Third sheet is my Calculation table. Taking Start Date End date and listing
them,
Then converting those dates in to Julian dates without the year.
I would like to colour the cells on the sheet "Globalview" that match the
holiday
This is a sample of my code "Its not working " and just can't get it. Probably
way off.
-------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Dim ws As Worksheet
Dim GV As Range
Dim CT As Range


On Error GoTo ws_exit:

With Worksheets("GlobalView")
GV = Range("c5:bc9")
End With

With Worksheets("CalcTable")
CT = Range("Julian") 'Range E3:E133
End With

For Each cell In Worksheets("Global View").Range("GV")
GV = Worksheets("CalcTable").Range("CT")

cell.Interior.ColorIndex = 10

Next cell
End Sub

I tested everything with Conditional Formatting and it works "BUT" only 3
Condition and I need 17
The link below is a JPEG showing a snippet of the 3 sheets to give a better
idea I hope
http://www.mediafire.com/?zczmqzngm40
Thanking you in advance
John