1

マクロ レコーダーのこのコードを使用し、for ループ内に追加します。

可能であれば、このコードをどのように改善できますか?

2003年と2010年両方使いたいです。

Range(Cells(2, 2).Address, Cells(5, 5).Address).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
    .LineStyle = xlDouble
    .Color = -16777216
    .Weight = xlThick
End With
With Selection.Borders(xlEdgeTop)
    .LineStyle = xlDouble
    .Color = -16777216
    .Weight = xlThick
End With
With Selection.Borders(xlEdgeBottom)
    .LineStyle = xlDouble
    .Color = -16777216
    .Weight = xlThick
End With
With Selection.Borders(xlEdgeRight)
    .LineStyle = xlDouble
    .Color = -16777216
    .Weight = xlThick
End With
With Selection.Borders(xlInsideVertical)
    .LineStyle = xlContinuous
    .ColorIndex = xlAutomatic
    .Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
    .LineStyle = xlContinuous
    .ColorIndex = xlAutomatic
    .Weight = xlThin
End With
4

2 に答える 2

1

このような範囲を使用してみてください

Range(Cells(2, 2).Address, Cells(5, 5).Address).Borders(xlEdgeBottom).LineStyle = xlDouble

境界線のエッジや色などごとにこれを行います

于 2013-04-06T12:48:35.640 に答える