Conditional copy

L

ledzepe

Hi everyone,

On Sheet1 ColumnA, I got data that repeats itself and each row contains
.. For example:
apple data1
orange data2
apple data3
banana data4
orange data5
apple data6

On sheet2, I want to copy, from Sheet1, all rows with "apple" in column
A. The result would look like:
apple data1
apple data3
apple data6

Is there a way to automate this? The way I do it by AutoFilter Sheet 1
or by sorting it then do a copy and paste. Its a bit tedious because
this is a ten page document.
 
D

Dave Peterson

If I only need that one sheet (with Apple), I'd do it manually.

But if I needed a sheet for each fruit, then I'd use a macro...

Debra Dalgleish and Ron de Bruin have samples that you may like. Ron's addin
may be sufficient right out of the box.

Debra's site:
http://www.contextures.com/excelfiles.html

Create New Sheets from Filtered List -- uses an Advanced Filter to create
separate sheet of orders for each sales rep visible in a filtered list; macro
automates the filter. AdvFilterRepFiltered.xls 35 kb

or

Update Sheets from Master -- uses an Advanced Filter to send data from
Master sheet to individual worksheets -- replaces old data with current.
AdvFilterCity.xls 55 kb

And Ron de Bruin's easyfilter.
http://www.rondebruin.nl/easyfilter.htm

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

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