ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extracting data from multiple worksheets (https://www.excelbanter.com/excel-programming/432873-extracting-data-multiple-worksheets.html)

R NG

Extracting data from multiple worksheets
 
I have a workbook with 3 worksheets, WS1, WS2 and an empty worksheet.
I need to extract rows meeting some criteria from WS1 and WS2 to the empty
worksheet.

To simplify things a little, WS1 is as follows
col1 col2 col3
1 2 a
2 4 b
1 6 c

WS2 is as follows:
col1 col2 col3
4 2 d
6 5 c
2 3 b
1 5 c

I need to extract the rows from WS1 and WS2 with col3 equal to "c", and
display them in the empty worksheet. The result is:
col1 col2 col3
1 6 c
6 5 c
1 5 c

How do I do that using VBA?



Don Guillett

Extracting data from multiple worksheets
 
For each sheet Use datafilterautofilterfilter col 3 for ccopy to next
avail row on sh 3. Record a macro if desired and then clean it up.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"R NG" wrote in message
...
I have a workbook with 3 worksheets, WS1, WS2 and an empty worksheet.
I need to extract rows meeting some criteria from WS1 and WS2 to the empty
worksheet.

To simplify things a little, WS1 is as follows
col1 col2 col3
1 2 a
2 4 b
1 6 c

WS2 is as follows:
col1 col2 col3
4 2 d
6 5 c
2 3 b
1 5 c

I need to extract the rows from WS1 and WS2 with col3 equal to "c", and
display them in the empty worksheet. The result is:
col1 col2 col3
1 6 c
6 5 c
1 5 c

How do I do that using VBA?



R NG

Extracting data from multiple worksheets
 
Hi Don,

Your post gave me the idea of using filtering. As my criteria is actually
much more complex, I explored advanced filtering and found that that's
exactly what I need. Thank you very much. :-)


"Don Guillett"
...
For each sheet Use datafilterautofilterfilter col 3 for ccopy to next
avail row on sh 3. Record a macro if desired and then clean it up.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"R NG" wrote in message
...
I have a workbook with 3 worksheets, WS1, WS2 and an empty worksheet.
I need to extract rows meeting some criteria from WS1 and WS2 to the
empty worksheet.

To simplify things a little, WS1 is as follows
col1 col2 col3
1 2 a
2 4 b
1 6 c

WS2 is as follows:
col1 col2 col3
4 2 d
6 5 c
2 3 b
1 5 c

I need to extract the rows from WS1 and WS2 with col3 equal to "c", and
display them in the empty worksheet. The result is:
col1 col2 col3
1 6 c
6 5 c
1 5 c

How do I do that using VBA?





Don Guillett

Extracting data from multiple worksheets
 
Glad to help. Post your final macro for the archives

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"R NG" wrote in message
...
Hi Don,

Your post gave me the idea of using filtering. As my criteria is actually
much more complex, I explored advanced filtering and found that that's
exactly what I need. Thank you very much. :-)


"Don Guillett"
...
For each sheet Use datafilterautofilterfilter col 3 for ccopy to next
avail row on sh 3. Record a macro if desired and then clean it up.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"R NG" wrote in message
...
I have a workbook with 3 worksheets, WS1, WS2 and an empty worksheet.
I need to extract rows meeting some criteria from WS1 and WS2 to the
empty worksheet.

To simplify things a little, WS1 is as follows
col1 col2 col3
1 2 a
2 4 b
1 6 c

WS2 is as follows:
col1 col2 col3
4 2 d
6 5 c
2 3 b
1 5 c

I need to extract the rows from WS1 and WS2 with col3 equal to "c", and
display them in the empty worksheet. The result is:
col1 col2 col3
1 6 c
6 5 c
1 5 c

How do I do that using VBA?







All times are GMT +1. The time now is 10:58 AM.

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