Microsoft Excel – Automatic Copy Rows with Matched Column to Other Worksheet

microsoft excelmicrosoft-excel-2007worksheet-function

Now I have a worksheet named sheet1 like the left side of image enter image description here

I want to automatic copy all rows of sheet1 that have the column C = NO to worksheet sheet2 like the right side of image. And each time I insert new row of sheet1 with C column = NO, it will automatic update sheet2 with index column E auto increase.

Can anyone help me?

Best Answer

This sounds like a job for a PivotTable but you're going to need row headers.

First, setup a dynamic named range that will capture your list in A:C and grow along with it. To do this, click on the Name Manager in the Formulas ribbon. Click New, give it some name (I called mine rngPivotData) and use this for its "Refers to:" formula:

=OFFSET(Sheet1!$A$1,0,0,MATCH(9E+99,Sheet1!$A:$A),3)

Screenshot 1

Next, add a PivotTable by clicking in cell E1 and then clicking Pivot Table on the Insert riboon.

Screenshot 2

When it asks you the table or range to use, type the name you chose for the dynamic named range.

Screenshot 3

Right-click somewhere in the PivotTable and click on "PivotTable Options...". In the Display tab, check "Classic PivotTable layout". This will help give the look you want.

Screenshot 4

Drag all three headers into the Row Labels section of the PivotTable pane and then filter the Yes/No field for just those that are No. Screenshot 6

Here's the final product. Anytime you make changes, you can just right-click anywhere in the PivotTable and click Refresh. Screenshot 6

Related Question