Replacing VLOOKUP with VBA

michael1979

New Member
Joined
Oct 15, 2014
Messages
2
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.:confused:

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.:eek:

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

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,213,550
Messages
6,114,265
Members
448,558
Latest member
aivin

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