View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
DrwRob28 DrwRob28 is offline
external usenet poster
 
Posts: 4
Default Loop Down Columns and Compare Values

Tom,

Do you know how I can get it to skip to columns C and D, E and F,
etc.after it is doen with A and B?

Thanks,
Drew

DrwRob28 wrote:
Thanks Tom!\


Tom Ogilvy wrote:
set rng = Range("A1:A100")
rng.Resize(,2).Interior.ColorIndex = xlNone
for each cell in rng
if cell.Value cell.offset(0,1).Value then
cell.Resize(1,2).Interior.ColorIndex = 3
end if
Next

--
regards,
Tom Ogilvy

"DrwRob28" wrote in message
ups.com...
Hi,

I am trying to write a macro that will loop through columns (eg A and
B) and across the row and compare the values on the same row in
different columns and if the value in column A on that same row is
greater then I would like to highlight those cells. Is there anyone who
could help?

Thanks!