Hi Harry, in the code below, I gave the main numerical list (1,2,3,4,5,...)
the range name, "DataList". I gave the highlight items list (1,5,7 in your
example), the range name "HighlightList".
Sub HighlightListValues()
'Highlight values in a data list that are common to a highlight values list
Dim i As Integer, j As Integer
Dim DataListRows As Integer, HighlightListRows As Integer
'Determine the number of items in the data list and the highlights list
DataListRows = Application.WorksheetFunction.CountA(Range("DataLi st"))
HighlightListRows =
Application.WorksheetFunction.CountA(Range("Highli ghtList"))
'Clear any currently highlighted items in the data list
Range("DataList").Interior.ColorIndex = xlNone
'Highlight items in the data list that are also in the highlights list
For i = 1 To HighlightListRows
For j = 1 To DataListRows
If Range("DataList").Cells(j, 1).Value =
Range("HighlightList").Cells(i, 1).Value Then
Range("DataList").Cells(j, 1).Interior.ColorIndex = 36
End If
Next j
Next i
End Sub
"Harry88" wrote:
I am trying to create attention catching number pattern but I don't want
to manually enter each color pattern formating. Is there a way where I
enter a number and its associated color pattern will appear on the
number in another place ?
For example: series number in one column 1,2,3 4 ,5,6,7,8,9,10
I enter 1, 5, 7 on separate column
column 1,2,3 4 ,5,6,7,8,9,10
1, 5 & 7 's background color(pattern color) for the column will change
to yellow.
How to associate a particular group of numbers with certain pattern
color ?
Thanks...
--
Harry88
------------------------------------------------------------------------
Harry88's Profile: http://www.excelforum.com/member.php...o&userid=35297
View this thread: http://www.excelforum.com/showthread...hreadid=550797