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

前端 未结 4 1260
眼角桃花
眼角桃花 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:23

    why are all the answers so convoluted?

    for the entire sheet use...

    With .Cells
           .Borders.LineStyle = xlLineStyleNone
    End With
    

    for a range just replace .Cells as appropriate

提交回复
热议问题