Handling Variable Number of Rows in Lookup and Index

mhp620

New Member
Joined
Jan 6, 2010
Messages
25
Hi... I think this will require VBA..

I need a function that will look up the entries of Sheet1-Column-A in Sheet2-Column-A. If an entry in Sheet1-Column-A exists in Sheet2-Column-A, then I need to copy Sheet2-Column-D and Sheet2-Column-E into Sheet1-Column-D and Sheet1-Column-E. I need to do this for each row in Sheet1-Column-A with data.

The problem I'm not sure how to handle is that the number of rows in each of Sheet1-Column-A and Sheet2-Column-A will change from week to week.

Suggestions on how to handle this would be greatly appreciated.

Thanks. Mike
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
When you say "copy", do you actually mean "return the values from" ?
I'm assuming you do, because you referred to LOOKUP and Index in your thread title, and that's what those functions will do.
So, in that case, you can use references like D:D to refer to the whole of Col D, or even D:E to refer to the whole of Cols D and E.
There are some functions where you can not use this type of reference, but you can for VLOOKUP and INDEX.

There might be better ways of doing this, but this should work . . .
 
Upvote 0

Forum statistics

Threads
1,224,538
Messages
6,179,412
Members
452,912
Latest member
alicemil

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