To return all rows with "text" in colA with all columns..
Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula>}"
Apply this formula in Sheet2 cell A1 and copy/drag down and to the right as
required.
=IF(COUNTIF(Sheet1!$A$1:$A$1000,"test")<ROW(A1),"",
INDEX(Sheet1!A$1:A$1000,SMALL(IF(Sheet1!$A$1:$A$1000="test",
ROW($A$1:$A$1000)),ROW(A1))))