Extracting data from multiple worksheets

  • Thread starter Thread starter R NG
  • Start date Start date
R

R NG

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?
 
For each sheet Use data>filter>autofilter>filter col 3 for c>copy to next
avail row on sh 3. Record a macro if desired and then clean it up.
 
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. :-)
 
Back
Top