VBA dinamic vlookup table array based on if statement

morjaman

New Member
Joined
Jan 18, 2018
Messages
1
Hi there!


I will be grateful for some help.
I have WorkBook with 2 sheets in it.


sheet 1
namemacro / vlookup resultvalue1value2
AJ 11 4 426214040
AJ 11 4 42621272272
AJ 11 4 42621319319
AJ 11 4 42621128120
AJ 13 1 42651224224
AJ 13 1 42651286286
AJ 13 1 42651399175
AJ 13 2 426513232
AJ 13 2 42651200152
BJ 28 3 42951305305
BJ 28 3 42951496496
BJ 28 3 4295119991175
BJ 36 5 42978496496

<colgroup><col><col><col span="2"></colgroup><tbody>
</tbody>

sheet2
AJ 11 4 42621
AJ 13 1 42651
AJ 13 2 42651
AJ 21 2 42616
AJ 25 1 42622
AJ 25 1 42908
AJ 25 3 42908
BJ 28 3 42951
BJ 36 5 42978
CJ 38 1 42978
CJ 39 3 42985



<colgroup><col><col></colgroup><tbody>
</tbody>
My need is in the 1-st sheet in col.B macro to put formulas vlookup(A:A;sheet2!$A$1:$B$11;2;0)
until Value1 (col.C) > Value2 (col.D) (bolded) then to skip first row in table array vlookup(A:A;sheet2!$A$2:$B$11;2;0) and continue until value in Col.A <> ""

Any help will be appreciated.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,214,646
Messages
6,120,715
Members
448,985
Latest member
chocbudda

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