ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Translating numbers into number with color pattern (https://www.excelbanter.com/excel-programming/363939-translating-numbers-into-number-color-pattern.html)

Harry88

Translating numbers into number with color pattern
 

I am trying to create attention catching number pattern but I don't wan
to manually enter each color pattern formating. Is there a way where
enter a number and its associated color pattern will appear on th
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 chang
to yellow.

How to associate a particular group of numbers with certain patter
color ?

Thanks..

--
Harry8
-----------------------------------------------------------------------
Harry88's Profile: http://www.excelforum.com/member.php...fo&userid=3529
View this thread: http://www.excelforum.com/showthread.php?threadid=55079


Paul Mathews

Translating numbers into number with color pattern
 
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



Harry88[_2_]

Translating numbers into number with color pattern
 

Thanks Paul Mathews for your elegant solution..

--
Harry8
-----------------------------------------------------------------------
Harry88's Profile: http://www.excelforum.com/member.php...fo&userid=3529
View this thread: http://www.excelforum.com/showthread.php?threadid=55079



All times are GMT +1. The time now is 04:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com