Macro needed data query

G

GerryK

Hi,
Could I please get some help to create a macro to solve
this situation?

I have in Sheet1 data in columns A through W. (10,000 rows
(records) maximum).
On Sheet2 I would like to display all records from Sheet1
columns Q and R in columns A30 and B30 down that meet
criteria I place in Sheet2 J1:J4.

In other words I am attempting to populate Sheet2 A30 and
B30 down with data from columns Q and R from Sheet1 but
based on my entries in Sheet2 thus:
Sheet2 J1 entry will look for a match in Sheet 1 column B
Sheet2 J2 entry will look for a match in Sheet 1 column F
Sheet2 J3 entry will look for a match in Sheet 1 column L
Sheet2 J4 entry will look for a match in Sheet 1 column O

Is something like this even possible?
I was originally thinking of a multiple VLOOKUP scenario
but can only get 1 query to work on one column and now I'm
stuck.

TIA
Gerry
 
B

BrianB

I think Data/Filter/Advanced Filter will do what you want.

Stage 1. Your sheet 1 data should be in the form of a table wit
headings in row 1 and data below.

Stage 2 Your criteria range should be a worksheet range of at least
rows consisting of the top row containing exactly the same colum
names, and row(s) below containing the data match you wish to achiev
from those columns. In your case 4 columns & 2 rows, 1 containing th
names. 1 the criteria.

Stage 3. Open up Data/Filter/Advanced Filter and set the List Range
Criteria Range, and Destination (probably a new sheet)

Stage 4. Copy/Paste columns Q & R from stage 3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top