compare worksheet with access database, if matches import another field to excel

sdbeach

New Member
Joined
Aug 2, 2011
Messages
5
We use Excel to report part costs to our accounting department.

Some one generates a part list that has a VENDOR PART NUMBER.

We have a second excel sheet that lists this VENDOR NUMBER with our COMPANIES INTERNAL PART NUMBER.

I would like to be able to open a worksheet...have it compare the VENDOR NUMBER in the first sheet with the VENDOR NUMBER in the second speadsheet, and if they match ADD THE COMPANIES INTERNAL PART NUMBER to sheet 1.
[TABLE="width: 1036"]
<tbody>[TR]
[TD="class: xl65, width: 135"]

sheet 1

[TABLE="width: 200"]
<tbody>[TR]
[TD]Description[/TD]
[TD]vendor number[/TD]
[/TR]
[TR]
[TD]shim[/TD]
[TD][TABLE="width: 189"]
<tbody>[TR]
[TD="width: 189"]AFS1680[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]widget[/TD]
[TD][TABLE="width: 189"]
<tbody>[TR]
[TD="width: 189"]10209[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

Want to compare vendor number from sheet one with vendor number sheet two and add internal number to sheet 1


Sheet 2[/TD]
[TD="class: xl64, width: 111"][/TD]
[TD="class: xl65, width: 189"][/TD]
[TD="class: xl64, width: 359"]

[/TD]
[TD="class: xl66, width: 115, align: right"]7.7900[/TD]
[TD="class: xl67, width: 127"]EA.[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 200"]
<tbody>[TR]
[TD]Internal number[/TD]
[TD]vendor number[/TD]
[/TR]
[TR]
[TD]BAEALT205820[/TD]
[TD][TABLE="width: 189"]
<tbody>[TR]
[TD="width: 189"]AFS1680[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]BAEALT205821[/TD]
[TD][TABLE="width: 189"]
<tbody>[TR]
[TD="width: 189"]10209[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 2827"]
<tbody>[TR]
[TD="class: xl66, width: 135"]Result

[TABLE="width: 500"]
<tbody>[TR]
[TD]Description[/TD]
[TD]vendor number[/TD]
[TD]Internal number[/TD]
[/TR]
[TR]
[TD]shim[/TD]
[TD]AFS1680[/TD]
[TD]BAEALT205820[/TD]
[/TR]
</tbody>[/TABLE]

[/TD]
[TD="class: xl65, width: 111"][/TD]
[TD="class: xl66, width: 189"][/TD]
[TD="class: xl65, width: 359"][/TD]
[TD="class: xl67, width: 115, align: right"]7.7900[/TD]
[TD="class: xl68, width: 127"]EA.[/TD]
[TD="class: xl69, width: 63"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"] [/TD]
[/TR]
</tbody>[/TABLE]
I am new to VBA so I would appreciate any help. I know there is easier way like using databases, access, mysql etc....but this is the process that was requested.

Thanks for any help.
Scott
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,225,067
Messages
6,182,657
Members
453,131
Latest member
BeLocke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top