VBA单元格属性设置

Sub Clear_data()

' Create_data Macro

    Sheets("data").Select

    Range("c3:E5000").Select
    '削除指定されたのフォマード
    Selection.ClearFormats
    '削除指定されたの文字、
    Selection.ClearContents
    
    '選択セットシートの範囲
    Range("c3:E2002").Select
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    
    '垂直方向内側
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .ColorIndex = 1              '色番号 (1~56)
        .TintAndShade = 1            '色合いとシェード
        .Weight = xlHairline         'xlThick(太い線) xlMedium(中) xlThin(薄い) xlHairline(最も細い)
    End With
    
    '内側水平
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .ColorIndex = 1
        .TintAndShade = 1
        .Weight = xlHairline
    End With

End Sub

你可能感兴趣的:(笔记,VBA笔记,python,开发语言)