View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Roderick O'Regan Roderick O'Regan is offline
external usenet poster
 
Posts: 2
Default 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.