ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   searching and copying (https://www.excelbanter.com/excel-worksheet-functions/170994-searching-copying.html)

goalman55

searching and copying
 
Does anyone know a way that I can search a worksheet down column C, when it
is blank see if column A in the corresponding row has a number, if it does,
copy the entire row A through M and paste it on another sheet then do the
same thing on the next row down? This process would conitnue until the macro
found that both the cells in columns A and C were blank.

Max

searching and copying
 
One play which does it using formulas ..

Assume source data to be monitored is in a sheet: x,
cols A to M, data from row1 down

In another sheet,
Put in A1:
=IF(AND(x!C1="",ISNUMBER(x!A1)),ROW(),"")

Put in B1:
=IF(ROW()COUNT($A:$A),"",IF(INDEX(x!A:A,SMALL($A: $A,ROW()))=0,"",INDEX(x!A:A,SMALL($A:$A,ROW()))))
Copy B1 across to N1. Select A1:N1, copy down to cover the max expected
extent of source data in x, say down to N200? Hide away col A. Cols B to N
will return the required result lines from x's cols A to M, all neatly
bunched at the top.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"goalman55" wrote:
Does anyone know a way that I can search a worksheet down column C, when it
is blank see if column A in the corresponding row has a number, if it does,
copy the entire row A through M and paste it on another sheet then do the
same thing on the next row down? This process would conitnue until the macro
found that both the cells in columns A and C were blank.



All times are GMT +1. The time now is 11:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com