This project has moved and is read-only. For the latest updates, please go here.

how to quickly copy columns using epplus?

Sep 2, 2011 at 3:43 AM
Edited Sep 2, 2011 at 5:02 AM

I want to move columns (eg. from column H --> column B) and each column has many cells.
my current method is to copy cell by cell:
or .copy method

But it acts far too slow
Is there any solution much quicker? like copy an entire column to another sheet?

Sep 20, 2011 at 8:48 PM


You can use the Range.Copy method, but it will still be slow.

The problem is that when you copy cells by column the internal index will have to sort for every cell with the current desigen. So the best approch is to load a cell from Left to right, up to down.

A workaround, if you know the number of columns to be created is to make sure the cells are created before you start to copying.

You can do something like this (the address is just an example)...

Not very pretty, but should make the copy faster.