Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding an item in a list and then copying the record

Status
Not open for further replies.

virgo

Programmer
Jun 21, 1999
88
US
This should be easy, but it isn't.

I need to check the id numbers in one list against the id numbers in another list.

These are presently in 2 worksheets, but they could be in one.

If the id number from the first list is present in the second list, then I need to copy the entire record to a third list. [sig][/sig]
 
First off, you need to tell us which software package you are using. when you say worksheet it sounds like Excel, but when you say record it sounds like access.

In access this is easy, just create a linked query with two tables and do an if true comparison. My VB and SQL isn't all that good so maybe someone else could help you with that part.

In excel it's just as easy as long as the worksheets are in the same spreadsheet. Do an if comparison on the cells from either worksheet then copy the pertinant cells.

-cm
[sig][/sig]
 
I presently have a database in Excel 97. The database was originally in DB4.

I can get it to work for the first row. I basically am using an if. I have also tried criteria. It gives me the same results.

I can't get the thing to repeat. So, I may be doing something wrong.

Worksheet number 1 is smaller. Some of these ids are found in worksheet number 2.

If the id is in worksheet number 2, the row (or record) needs to be copied to a third worksheet.

I may also try this in Access. I am not as good with Access as with Excel, therefore Excel. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top