How to remove borders from cells in a range in Excel using VB.net?

前端 未结 4 1230
眼角桃花
眼角桃花 2021-01-11 13:32

Aim to Achieve: To get rid of borders if any in the cells of range.

I have :

Dim range As Excel.Range = sheet.Range(\"A2:K100\")
For         


        
4条回答
  •  心在旅途
    2021-01-11 14:16

    Check NamedRange.BorderAround Method .

    Dim range As Excel.Range = sheet.Range("A2:K100")
    range.BorderAround(Excel.XlLineStyle.xlLineStyleNone, Excel.XlBorderWeight.xlThin, Microsoft.Office.Interop.Excel.XlColorIndex.xlColorIndexAutomatic, missing)
    

    cheers and good luck!

提交回复
热议问题