Integrate VLOOKUP in VBA

Bart1980

New Member
Joined
Sep 24, 2016
Messages
8
Hello everyone,

I have a workbook with two worksheets namely "1" and "Sheet1". I would like to write a macro which integrates the VLOOKUP function.

My working function is as follows: =IF(H2="";"";VLOOKUP(H2;Sheet1!A:C;3;False) but I am kind of stuck with how to get it to work in VBA.

In Worksheet "1" I want to write the results in column J, starting from J2 of course. If the value of H2 from this Worksheet matches a value in Worksheet "Sheet1" column A, then write the corresponding value of Sheet1 column C in J2. Do this for all the values in Worksheet "1" column H.

Hope one of you can help me out.
Thanks in advance,

Bart
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Do you want to put the formula into the cell, or the value it returns?
Also how many rows do you have on both sheets?
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,286
Members
449,076
Latest member
kenyanscott

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