Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: Inserting Rows without a Loop

$
0
0
Hello!

I've got a problem with inserting rows.
I have an Excel spreadsheet with about 5k rows. I want to insert an additional row after each row that matches a certain criteria and add a formula to it (SUMIF). Doing this in a loop works with small data, but with about 3,5k rows to insert, I always run into an Out Of Memory-exception (because of the recalculation of row numbers and formulas for each iteration).

Is there a better way to accomplish this? From the documentation I've drawn that it is faster to insert them all at once, but if I do this, I can't properly keep track of where they belong (just below the original row) and the data I want them to contain.

I simply cannot wrap my head around this.
Thank you for your help and for creating this awesome library!

-galatyr

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>