Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Unmatched Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vrk1 - 19 Mar 2008 22:54 GMT
Hi,

My customer wants an "Unmatched Query" done in Excel.  He doesn't want to
use MS Access to create this.  Is there a Macro or inbuilt Excel function
that would let us do this?

Scenario:
In a single workbook, there are 3 spreadsheets - spr1, spr2, and spr3.  spr1
and spr2 have just one columns of names in them.  My customer wants to find
all the names in spr2 that does not match with the names in spr1 and transfer
the result in spr3.

Is this possible?  Please help.
Joel - 20 Mar 2008 11:39 GMT
Sub unmatched()

spr3RowCount = 1
spr2RowCount = 1
With Sheets("spr2")
  Do While .Range("A" & spr2RowCount) <> ""
     FindNum = .Range("A" & spr2RowCount)
     With Sheets("spr1")
        Set c = .Columns("A:A").Find(what:=FindNum, _
           LookIn:=xlValues, lookat:=xlWhole)
        If c Is Nothing Then
           Sheets("spr3").Range("A" & spr3RowCount) = FindNum
           spr3RowCount = spr3RowCount + 1
        End If
     
     End With
     spr2RowCount = spr2RowCount + 1
  Loop
End With

End Sub

> Hi,
>
[quoted text clipped - 9 lines]
>
> Is this possible?  Please help.
Mike Fogleman - 20 Mar 2008 11:45 GMT
There is not a single function that does this, but Chip Pearson illustrates
how to do this with a combination of 3 functions assembled into a formula.
Look at the 3rd example on this page for Extracting Elements From One List
Not On Another List.

http://www.cpearson.com/excel/ListFunctions.aspx

Once you have the list on spr3, select that list and Copy/PasteSpecial
Values to remove the formulas and keep the results. Now sort the results to
remove blank rows.

Mike F
> Hi,
>
[quoted text clipped - 12 lines]
>
> Is this possible?  Please help.
vrk1 - 20 Mar 2008 17:47 GMT
Both the solutions described on this thread gave me the solution that I was
looking for.  Thank you both.  Hope this would help others searching the
forum.

> There is not a single function that does this, but Chip Pearson illustrates
> how to do this with a combination of 3 functions assembled into a formula.
[quoted text clipped - 24 lines]
> >
> > Is this possible?  Please help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.