LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
ll ll is offline
external usenet poster
 
Posts: 67
Default return non matches

Hi,
I am working with a script to try and return non matches. I have set
up two ranges and have set up nested loops to compare them. The
problem I'm currently having is that, even with the operator set to
"<", even the matches get returned for some reason.
Does anyone have any ideas as to why this would do that? (Script
below)
Thanks very much,
Louis
======================
Sub Find_Matches()
Dim CompareRange1 As Variant, x1 As Variant, y1 As Variant
Dim CompareRange2 As Variant, x2 As Variant, y2 As Variant
' Set CompareRange equal to the range to which you will
' compare the selection.
Set CompareRange1 = Worksheets("Sheet1").Range("A1:A5")
Set CompareRange2 = Worksheets("Sheet2").Range("A1:A5")

' Loop through each cell in the selection and compare it to
' each cell in CompareRange.

For Each x1 In CompareRange1
For Each y2 In CompareRange2

If x1 < y2 Then x1.Offset(0, 1) = x1

Next y2
Next x1
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
If value matches criteria, return formula DJ Excel Worksheet Functions 3 October 8th 09 05:21 PM
Return value of non matches in columns Gemi Excel Discussion (Misc queries) 4 March 5th 09 07:40 PM
Count values only if matches and return on another worksheet candacer Excel Worksheet Functions 3 May 27th 08 09:49 PM
How do I use lookup to return multiple matches and sum them? Nat Excel Discussion (Misc queries) 1 August 15th 06 06:23 PM
Vlookup to return the sum of multiple matches AussieExcelUser Excel Discussion (Misc queries) 3 August 1st 06 12:29 AM


All times are GMT +1. The time now is 12:48 AM.

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"