Excel表设置为细框线

Sub 设置为细框线()
    边框类型数组 = Array(xlEdgeLeft, xlEdgeTop, xlEdgeBottom, _
                       xlEdgeRight, xlInsideVertical, xlInsideHorizontal)
    '遍历已使用区域的每个单元格
    For Each 单元格 In ActiveSheet.UsedRange
        For Each 边框类型 In 边框类型数组
            If 单元格.Borders(边框类型).LineStyle <> xlNone Then 单元格.Borders(边框类型).Weight = xlThin
        Next
    Next
End Sub
posted @ 2025-10-04 23:20  python_learn  阅读(7)  评论(0)    收藏  举报