VBA code of vlookup with IF condition

Saleem29

New Member
Joined
Jul 20, 2017
Messages
1
Hi,

I have an excel template in which I need to apply the VBA code for Vlookup with IF condition. If the codes in Book A & Book B matches then in the "New Date" column in Book A should be updated as per "Prior Date" from Book B. If its shows #N/A then the same date should be updated in the New date column.

Like in this case: Book A: The New date and date should be same because the Code B is not there in the Book B.

Book A

CodeDate New Date
A1/1/201612/12/2016
B2/3/2016#N/A
C5/4/20164/6/2016
D9/10/20163/5/2016

<tbody>
</tbody><colgroup><col><col><col></colgroup>

Book B
CodePrior Date
A12/12/2016
C4/6/2016
D3/5/2016
G4/5/2016

<tbody>
</tbody><colgroup><col><col></colgroup>


Thanks

<tbody>
</tbody><colgroup><col><col><col></colgroup>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,214,584
Messages
6,120,384
Members
448,956
Latest member
JPav

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