VBA to use Vlookup on another spreadsheet.

ManxBen

New Member
Joined
Nov 15, 2016
Messages
3
Hi All

Looking for some help with a VBA code.

Each day I get 2 reports generated from different systems.

The first shows the current status of orders and the second shows whether money has been received.

The first spreadsheets data looks like:

[TABLE="width: 503"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]Status[/TD]
[TD]Order Number[/TD]
[/TR]
[TR]
[TD]Tim[/TD]
[TD]01/11/2016[/TD]
[TD]Pending payment[/TD]
[TD]111111111[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]15/11/2016[/TD]
[TD]Pending payment[/TD]
[TD]222222222[/TD]
[/TR]
[TR]
[TD]Sam[/TD]
[TD]17/11/2016[/TD]
[TD]Pending payment[/TD]
[TD]333333333[/TD]
[/TR]
[TR]
[TD]Leah[/TD]
[TD]20/11/2016[/TD]
[TD]Pending payment[/TD]
[TD]444444444[/TD]
[/TR]
[TR]
[TD]Luke[/TD]
[TD]21/11/2016[/TD]
[TD]Pending payment[/TD]
[TD]555555555[/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]21/11/2016[/TD]
[TD]Pending payment[/TD]
[TD]666666666[/TD]
[/TR]
</tbody>[/TABLE]


The Second reports data looks like


[TABLE="width: 530"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Order Number[/TD]
[TD]Currency Received[/TD]
[TD]Amount Received[/TD]
[TD]Date received[/TD]
[/TR]
[TR]
[TD]222222222[/TD]
[TD]GBP[/TD]
[TD]1000[/TD]
[TD]20/11/2016[/TD]
[/TR]
[TR]
[TD]444444444[/TD]
[TD]EUR[/TD]
[TD]1200[/TD]
[TD]21/11/2016[/TD]
[/TR]
[TR]
[TD]666666666[/TD]
[TD]USD[/TD]
[TD]999.99[/TD]
[TD]21/11/2016

[/TD]
[/TR]
</tbody>[/TABLE]


I would like to add a VBA code to the first spreadsheet to use a Vlookup to source data from the second Spreasheet to identify where funds have been received.

The second spreadsheet is saved within C:\Users\John\Documents\Payment Report.xlsx

Could someone assist me in how to I add a Vlookup to column E, F and G to return the Currency, Amount and date from the Payment Report. if the Order number is on both reports.

This will also need to go to the last row of data so if you could include this that would be great.

Thanks
Ben
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi Ben,
how far did you get with formulas/recording a macro? Please do post your code here (in [ CODE ] brackets), so we can give you some feedback.
Cheers,
Koen
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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