Replacing VLOOKUP with VBA

michael1979

New Member
Hi,

I am brand new to this forum and have only used normal formulas in excel, therefore my VBA skills are still very limited, but my need very urgent. I have scouted the net and forums and found several posts and solutions, which might solve my issue, I just cannot get them to fit.

The problem is that I need to lookup a range of material numbers in a column (The range will vary from time to time), and fetch the data in various columns in another workbook where the data is listed including the material numbers.

The data shall be inserted as values only and in designated columns.

Currently I have a number of columns with a variation of the same vlookup function, which is quite elaborate and is now also causing excel to freeze, as the code is copied into many rows and columns, which then all are trying to fetch data regardless of whether there is a material number or not.

Below is an example of the code:

=IF(B15="";"";IF(LEN(B15)=10;IF(ISNA(VLOOKUP(B15;'[Grossistkalk.xlsx]Grossistkalk 1'!\$A\$2:\$AA\$20000;MATCH("Materiale type";'[Grossistkalk.xlsx]Grossistkalk 1'!\$A\$1:\$U\$1;0);FALSE))=FALSE;VLOOKUP(B15;'[Grossistkalk.xlsx]Grossistkalk 1'!\$A\$2:\$AA\$20000;MATCH("Materiale type";'[Grossistkalk.xlsx]Grossistkalk 1'!\$A\$1:\$U\$1;0);FALSE);"Fejl i EL-nr.")))

I hope someone can help as I am getting desperate.

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

michael1979

New Member
If I am not being specific enough let me know, as I would very much appreciate an answer.

Replies
1
Views
316
Replies
22
Views
491
Replies
3
Views
540
Replies
4
Views
133
Replies
2
Views
696

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

1,151,978
Messages
5,767,419
Members
425,411
Latest member
sarmientojayexce03

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.

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

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