View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Cecilkumara Fernando Cecilkumara Fernando is offline
external usenet poster
 
Posts: 46
Default Creating macro code in Excel

Paul,
This will give you a start,
Cecil

Sub Macro1()
Range("A1").Select
For i = 1 To 5
Cells.Find(What:=i * 10, After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Interior.ColorIndex = i + 10
Next i
End Sub

"Paul" wrote in message
...
Hi There,

Can anyone give me some tips or idea on how to create a
macro that would change the color of my data in a table.
Please see my excel sample table below:

look up table: 10 20 30 40 50 60

Col1 Col2 Col3 Col4 Col5 Col6
Row1 10 11 12 13 14 15
Row2 16 17 18 19 20 21
.
.
.
Row10 35 36 37 38 39 40

Here how it goes, for example in the look up table I have
10 and when I find 10 in Row1/Col1 I would like to change
it to color RED, Then, If I have 20 in lookup table and I
find it from Row2/Col5 I would change it to color BLUE,
and so on.

Can anybody have an idea on this?

Appreciate your help. thanks
Paul