Disclaimer: I’m just guessing at what you really want and came up with a solution for my own entertainment, based on my guess.
I used several formulas.
Assumption 1: You have a header row.
Assumption 2: Your data range is Sheet1!A1:I29, where A1:A29 is the copy criteria.
Assumption 3: Copy criteria is if the cell in col A is greater than 0, values in columns B:I are to appear on Sheet2.
Assumption 4: It’s OK to have blank formula results, where the result is “”.
First I put a formula in cell J2: =IF(A2>0,COUNT($J$1:J1)+1,"")
That formula returns the count of valid fields in A1:A29. If every row is valid, J2 will be 1, J3 will be 2, J4 is 3… J29 is 28. If all the fields in A1:A29 are valid except A4 (which is zero), J2 will be 1, J3 will be 2, J4 is “”, J5 is 3… J29 is 27. If only A29 is valid, J2:J28 are all “”, and J29 is 1.
You mentioned another criteria, EmAnJ. Add another IF statement to the formulas in J, like IF(B2<>foo,"",IF(A2>0,COUNT($J$1:J1)+1,"").
On to Sheet2.
Sheet2!A2:A29 is 1 to 28. This could be done away with by adding a ROW statement to the next formula, if that’s an issue.
Then I put
=IF($A2>MAX(Sheet1!$J$2:$J$29),"",OFFSET(Sheet1!$B$1,MATCH($A2,Sheet1!$J$2:$J$29,0),0))
in Sheet2!B2. Then I copied that formula across Sheet2!B2:I29.
Then I got annoyed with myself for being so lazy and replaced it with
=IF(ROW(B2)-1>MAX(Sheet1!$J$2:$J$29),"",OFFSET(Sheet1!$B$1,MATCH(ROW(B2)-1,Sheet1!$J$2:$J$29,0),0))
and copied it across the output range again, so I didn’t need that extra helper column.
I can email it to you if you like, it’s XL 2010.