Separating data into new sheet

A

apache007

Hi guys,

I have the following data on worksheet "Sheet1"

Code Value
A 1000
B 200
A 100
C 150
B 300
B 200
C 400


I have worksheet "Sheet2" that I want user to input what CODE they want to
IMPORT...
Let say A

then on "Sheet2" i would get:

Code Value
A 1000
A 100

It is a combination of sorting, copying and moving the wanted data to the
targeted sheet.
Is there an excel feature/solution that does this? or a VB code is needed?


Thanks in advance
 
M

Max

One way ..
Your source table as posted in Sheet1, data from row2 down
In Sheet2,
Let's say the input for the code will be made in A2, eg: A
In C2: =IF(A$2="","",IF(A$2=Sheet1!A2,ROW(),""))
In D2:
=IF(ROWS($1:1)>COUNT($C:$C),"",INDEX(Sheet1!A:A,SMALL($C:$C,ROWS($1:1))))
Copy D2 to E2. Select C2:E2, copy down all the way to cover the max expected
extent of data in Sheet1's col A. Minimize col C. Cols D & E returns the
required results dependent on the input code in A2, all neatly packed at the
top. Joy? hit the YES below
 

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