简体   繁体   中英

Copy a very large number of rows from one sheet to another, excluding blank rows in Excel 2010

I'm currently working on an excel workbook using the following formula to copy all rows from one sheet (Creation_Series_R) to another one, excluding empty rows.

{=IFERROR(INDEX(Creation_Series_R!C:C;SMALL(IF(Creation_Series_R!$C$3:$C$20402<>"";ROW(Creation_Series_R!$C$3:$C$20402));ROW()-ROW(Creation_Series_R!$C$3)+1));"")}

And the formula works very well. Except, when I did my proof of concept I only had a few rows but with the final data, I need to work on 20400 rows... adding to the fact that I have 17 columns, and 3 similar sheets with similar formula, my workbook takes an hour to compute every time I input just one value.

This workbook is designed as a way for a client to enter data, and then it reorganize the data so that it can be imported directly in our software. I already limited the number of data the user can enter per workbook (to their very big disappointment), so I can't really reduce it to less than 20400 rows (it's only a 100 funds financial data).

Is there a way, even maybe using macro, I could do this more efficiently ?

The big block of array formulas is killing your performance (time-wise) .

If your data is in column A through Q , then I would use column R as a "helper" column. In R2 insert:

=COUNTA(A2:Q2)

and copy down. The macro would:

  • AutoFilter column R
  • Hide all rows showing 0 in column R
  • Copy the visible rows and paste elsewhere as a block

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM