Please help with code. Thanks!

D

Damil4real

I have a workbook with 3 sheets in it.

On sheet1 is a list of data from column A to M

One sheet2 is a list of another data from column A to J

No data in Sheet3.

The data in Sheet2 is imported (import external data) daily from a
word document that is saved as .txt and pasted into Sheet2 starting
from A1. Real Data begins at A10.

Both Data in Sheet2 and Sheet3 are similar except that data in Column
A in Sheet1 might be “Microsoft Exchange”, while the same name in
Sheet2 Column A is “Micro Exch”

For each Name like the one I mentioned above, there are different sub-
names that goes with them.

Example:

Data in Sheet1

Col A Col B Col
C Col D Col E

Microsoft
John Nevada
2.5 1.5 2
Smith New York 2.5
1.5 2
Smith New York 2.5
1.5 2
Smith TX
4.5 1.5 2


Data in Sheet2

Col A Col B Col
C Col D Col E

Micro
Cage NV
2.5 1.5 2
Smith TX
4.5 1.5 2

...etc

I want to be able to match all of the data in Sheet1 (column A to M)
in Sheet2 column (column A to M…although column length is from A to J)
and paste them into Sheet3.

What’s the best way to accomplish this?

I think it’s impossible, but I hope I’m wrong.

Please help!

Thanks!
 
D

Dave Mills

Start by inserting two additional columns in Sheet 1 with the same names as will
appear in sheet 2. I assume sheet 1 does not change so with the additional 2
columns you have something to match between the sheets. Then short sheets 1 and
2 by the matching data. It is then relatively simple to read the data in sheet
1. then find the match in sheet 2 and copy the values from the rows in both
sheets to the next available row in sheet 3.

There a few bits that will need to be decided like what if there is data in
sheet 1 and not match or data in sheet 2 with no matching sheet 1 entry. How you
do this will depend upon what you want to achieve in the results. For example do
you want sheet 1's data in sheet 3 if there is no match in sheet 2 or to just
ignore the sheet 1 entry or even insert an error note in sheet 3.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top