How to draw and clear a border around a cell or range of cells from C#


/ Published in: C#
Save to your folder(s)

remove border in excel from C#


Copy this code and paste it in your HTML
  1. public virtual void ClearThickBorderAround(Range cells)
  2. {
  3. Excel.Borders borders = cells.Borders;
  4. borders[Excel.XlBordersIndex.xlDiagonalUp].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  5. borders[Excel.XlBordersIndex.xlDiagonalDown].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  6. borders[Excel.XlBordersIndex.xlEdgeLeft].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  7. borders[Excel.XlBordersIndex.xlEdgeTop].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  8. borders[Excel.XlBordersIndex.xlEdgeBottom].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  9. borders[Excel.XlBordersIndex.xlEdgeRight].LineStyle = Excel.XlLineStyle.xlLineStyleNone;
  10. }

URL: http://www.nullskull.com/faq/1893/how-to-draw-and-clear-a-border-around-a-cell-or-range-of-cells.aspx

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.