Writing neat code
Thanks a lot.
It works a treat! And looks neater too.
Code like what it should be proper writted!
Roderick
On Fri, 30 Dec 2005 10:47:02 -0800, "K Dales"
wrote:
For Each cell In rng1
res = Application.Match(cell, rng3, 0)
If Not IsError(res) Then cell.Interior.ColorIndex = 8
res = Application.Match(cell, rng4, 0)
If Not IsError(res) Then cell.Interior.ColorIndex = 10
res = Application.Match(cell, rng5, 0)
If Not IsError(res) Then cell.Interior.ColorIndex = 12
res = Application.Match(cell, rng6, 0)
If Not IsError(res) Then cell.Interior.ColorIndex = 14
Next
This will execute faster, also.
|