LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Matching Values in Columns problems

Hello,
I have written a macro that matches values in two columns and highlights the
matches. The problem arises in a loop that is searching in one column has
no match in the other. The code generates an error. Any input appreciated,
code follows.

Sub Match()
'Compares values in 2 columns and highlights if the same

For Nextloop = 1 To 50
ActiveCell.Offset(1, 0).Activate
i = 1
Do Until ActiveCell.Value = Range("b1").Offset(i, 0)
i = i + 1
Loop
If ActiveCell.Value = Range("b1").Offset(i, 0) Then
Range("b1").Offset(i, 0).Cells.Interior.ColorIndex = 17
If IsEmpty(ActiveCell) Then
Exit Sub
End If
End If
Next Nextloop
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Matching Values in Two Columns John Excel Discussion (Misc queries) 2 October 27th 09 01:23 PM
Find matching values in two different columns lmarstin Excel Worksheet Functions 5 July 14th 08 07:51 PM
Matching values in 2 columns richzip Excel Discussion (Misc queries) 1 January 24th 08 11:40 AM
Matching values in two columns Rob Excel Discussion (Misc queries) 4 December 6th 06 04:44 AM
Matching values in 2 columns Aonghus Excel Programming 2 November 9th 05 03:31 PM


All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"