Search : in
By :

Highlight values of column B in column D

Last answer on Sep 26, 2009 3:40:17 am BST kansara, on Sep 25, 2009 6:50:16 am BST 
 Report this message to moderators

Hello,
I made a sheet named Room List. In this sheet. I have 4 columns. In column D, I have numbers 1,2,3,4,5,6,7,8,9 in cells D2, D3, D4, D5, D6, D7, D8, D9, D10 respectively.
In column B, if I write any number, it should be highlighted by color in relative cell of column D.
Example: If I write number 5 in cell B2 of column B, a cell D6 should be highlighted by a different color because D6 contains number 5 which I wrote in cell B2.
Can I do that please? It will be great help to me if I will get response to this at the earliest.

Configuration: MS EXCEL 2007

Best answers for « Highlight values of column B in column D » in :
Excel - Extract identical cells of 2 columns ShowExcel - Extract identical cells of 2 columns Issue Solution Note Issue Hello, Got a list of words in column A Got a list of words in column B I am looking for a formula that will produce in column C a list of the words that...
Swapping two variables without using a temp variable ShowSwapping two variables without using a temp variable Using pointers Making use of a Macro Using pointers #include void change(int *,int*); int main () { int a=2,b=5; printf("Before : a=%d,b=%d\n",a,b); ...
[Excel] – Countif Formula Show[Excel] – Countif Formula Issue Solution Note Issue I have one excel file in that Column "B" has the "pending or Closed" Status and Column "C" has "Severity 1, Severity 2 and Severity 3" I want to count in one cell with "Pending...
Spreadsheet - Formulas ShowIntroduction to Formulas The main use of a spreadsheet is to automate calculations, which means using cells to perform operations based on values in other cells. The spreadsheet recalculates all the values each time a change is made to the value of...
Worksheet - Cells ShowThe Concept of a Cell A "cell" is the intersection between a line (horizontal) and a column (vertical) on a worksheet. Thus, the name of the line combined with the name of the column gives the cell's coordinates (the term address is sometimes also...

1

 venkat1926, on Sep 26, 2009 3:40:17 am BST

Right click the sheet TAB and lcick VIEWCODE. in that window copy paste this code
This is an event code.




Private Sub Worksheet_Change(ByVal Target As Range)
Dim cfind As Range
Range("d1:d9").Interior.ColorIndex = xlNone
If Target.Address <> "$B$2" Then Exit Sub
With Range("d1:d10")
Set cfind = .Cells.Find(what:=Target.Value, lookat:=xlWhole)
If Not cfind Is Nothing Then cfind.Interior.ColorIndex = 3
End With
End Sub


now type any number in B2 and see what happen in column D

Reply to venkat1926