How can a border be set around multiple cells in excel using C#

后端 未结 8 1506
无人共我
无人共我 2020-12-18 22:18

I am working on a project that creates excel files.

I am having trouble placing a border on multiple cells to organize the excel file.

Let\'s say I want a b

8条回答
  •  一向
    一向 (楼主)
    2020-12-18 22:45

    I did this without impacting the performance. I am taking a simple excel to format :

    Before

    I managed to store the range as A1:C4 in a variable dynamically in exRange and used the below code to give border

    ((Range)excelSheet.get_Range(exRange)).Cells.Borders.LineStyle = XlLineStyle.xlContinuous;
    


    After

提交回复
热议问题