I'm trying to easily represent a relationship between the active cell, and a set of other cells, preferably using conditional formatting.
I'm essentially making a Gantt chart, and would like to be able to shade cells a different color to identify dependencies. So the idea is that in Column A I have a set of task IDs, and in Column B I have the description, and Column C is a set of dependencies.
When I have something like 'B3' selected, it'd look at the value in C3 (a comma-separated list of ID's contained within Column A) to determine which matching rows, as identified by the ID's in Column A, are dependencies - then color those differently.
This would switch based on the active cell.
I'm guessing this isn't doable with conditional formatting, and may need to do some VBA or come up with a different way to identify these relationships. Has anybody done anything similar?
Let's say I have my simple table set up something like this:
Task ID | Description | Dependencies
--------|-------------|-------------
1 | Task One |
2 | Task Two | 1
3 | Task Three |
4 | Task Four | 1, 3
5 | Task Five | 1, 2, 4
When I have the "1, 3" cell selected (next to Task Four) I'd want Task One and Task Three to be highlighted.
I added some VBA code to update some conditional formatting in real time.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Calculate
End Sub
I have some conditional formatting working to highlight a different cell in the same row as what I've got as the active cell:
=CELL("address")=CELL("address",$C2)
Applies to the column I want to highlight, Column B
But I don't want to always highlight the adjacent cell...I want to find the proper tasks based on the values in the Dependencies column.