Excel VBA Vlookup

mack22

New Member
Joined
Jun 18, 2018
Messages
7
Hi Guys
I am wanting to copy rows of data from one workbook to another based on a value.

Workbook1 has a list of car parts from vehicles/stock no
[TABLE="width: 500"]
<tbody>[TR]
[TD]stock no[/TD]
[TD]model name[/TD]
[TD]year model[/TD]
[TD]part name[/TD]
[/TR]
[TR]
[TD]a005013[/TD]
[TD]911[/TD]
[TD]2003[/TD]
[TD]rear spoiler[/TD]
[/TR]
[TR]
[TD]a005013[/TD]
[TD]911[/TD]
[TD]2003[/TD]
[TD]wiper motor[/TD]
[/TR]
[TR]
[TD]a005055[/TD]
[TD]911[/TD]
[TD]2005[/TD]
[TD]drivers airbag[/TD]
[/TR]
[TR]
[TD]a005055[/TD]
[TD]911[/TD]
[TD]2005[/TD]
[TD]driveshaft[/TD]
[/TR]
</tbody>[/TABLE]

Workbook2 needs to lookup the parts from workbook1 and copy the rows into workbook2 using a command button based on the stock no
so if stock no a005055 was entered it would copy 2 rows into workbook2.

Hope this makes!!
Many thanks
 
I have another question for you I would also like to update data from Workbook 1 to Workbook 2 without duplicating it.
Workbook 1 looks like this
[TABLE="class: cms_table, width: 500"]
<tbody>[TR]
[TD]stock no[/TD]
[TD]model name[/TD]
[TD]year model[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005013[/TD]
[TD]911[/TD]
[TD]2003[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005012[/TD]
[TD]911[/TD]
[TD]2003[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005011[/TD]
[TD]911[/TD]
[TD]2005[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005010[/TD]
[TD]911[/TD]
[TD]2005[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Workbook 2 looks the same but needs to have the new stock no's added to it, so workbook 2 would need to have stock no a005011, a005012 and a005013 when command button clicked
[TABLE="class: cms_table, width: 500"]
<tbody>[TR]
[TD]stock no[/TD]
[TD]model name[/TD]
[TD]year model[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005010[/TD]
[TD]911[/TD]
[TD]2005[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005009[/TD]
[TD]911[/TD]
[TD]2003[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thanks again :)
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I have another question for you I would also like to update data from Workbook 1 to Workbook 2 without duplicating it.
Workbook 1 looks like this
[TABLE="class: cms_table, width: 500"]
<tbody>[TR]
[TD]stock no[/TD]
[TD]model name[/TD]
[TD]year model[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005013[/TD]
[TD]911[/TD]
[TD]2003[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005012[/TD]
[TD]911[/TD]
[TD]2003[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005011[/TD]
[TD]911[/TD]
[TD]2005[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005010[/TD]
[TD]911[/TD]
[TD]2005[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Workbook 2 looks the same but needs to have the new stock no's added to it, so workbook 2 would need to have stock no a005011, a005012 and a005013 when command button clicked
[TABLE="class: cms_table, width: 500"]
<tbody>[TR]
[TD]stock no[/TD]
[TD]model name[/TD]
[TD]year model[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005010[/TD]
[TD]911[/TD]
[TD]2005[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a005009[/TD]
[TD]911[/TD]
[TD]2003[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thanks again :)

You need to start a new posting for this question.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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