Delete an entire column

Jun 24, 2011 at 10:19 PM

I was trying to delete an entire column on a sheet but could not find any API method. There is a method to Hide the column.

Any suggestion?

Thanks

Editor
Jun 27, 2011 at 1:37 PM

Did you try "worksheet.Column(idx).Hide();" ?

Jul 20, 2011 at 3:42 PM

Yes. As name says, it just hides the column. One can open the workbook and make the column visible.

Nov 14, 2011 at 3:11 PM

I'm having the same issue. Depending on certain conditions I need to delete an entire column from the spreadsheet. "Worksheet.Column(n).Hidden = true;" isn't just enough.

Is there a way to achieve that from EPPlus? The entire sheet is only values. No formulas that might crash.

Thanks in advance

Coordinator
Nov 17, 2011 at 6:35 AM

No, not in this version.

I haven't implemented inserts and deletes of columns mainly because it would not work well with large worksheets with the current design of the cell store.

The only way to delete a column is to move the cells yourself.

Jan 17, 2013 at 3:47 AM
JanKallman wrote:

No, not in this version.

I haven't implemented inserts and deletes of columns mainly because it would not work well with large worksheets with the current design of the cell store.

The only way to delete a column is to move the cells yourself.

 

If performance is the issue and moving is the only option, any plans of implementing the delete functionality that moves all the cells?

Hiding is not close enough to deleting the column.

Oct 21, 2013 at 9:31 AM
Edited Oct 21, 2013 at 9:31 AM
Any update on this feature? Even I am looking for delete column functionality.
Mar 17, 2014 at 9:03 AM
Version 4 beta with new cell store is now available. Is delete column functionality available there?
Coordinator
Mar 18, 2014 at 8:14 PM
It is in Cell Store, but I have not added the methods to the ExcelWorksheet class yet.
I'll add it to the next build, hopefully this week.
Jun 3, 2014 at 10:33 AM
Edited Jun 19, 2014 at 10:30 AM
Dear JanKallman,
What is the Status now regrading this issue? Is it implemented?
Is there a hack for the same?
Please let me know.
Aug 14, 2014 at 10:51 AM
Any updates about the delete column feature?
Nov 24, 2014 at 2:54 PM
Edited Nov 27, 2014 at 1:03 PM
Example to move cells with style, format and merged cells to simulate delete column please!
PD: Sorry for my bad English :)
Dec 2, 2014 at 6:17 AM
Any updates?
Apr 26, 2016 at 4:01 PM
The current version (I'm using 4.0.5, but it was also present in 4.0.4 and 4.0.3) does include the ability to write
sheet.DeleteColumn(i+1)

In 4.0.4, DeleteColumn was broken (it was clearing the column instead of deleting it), but now that I've installed 4.0.5, it seems to be fixed.