ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Separating data into new sheet (https://www.excelbanter.com/excel-discussion-misc-queries/257896-separating-data-into-new-sheet.html)

apache007

Separating data into new sheet
 
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

Max

Separating data into new sheet
 
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,SM ALL($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
--
Max
Singapore
---
"apache007" wrote:
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



All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com