Excel VBA テクニック集 |
簡単な罫線の引き方を紹介します。 下記のように「B2:F6」の罫線を引く場合、 「マクロの記録」で自動でVBAを作ると、 Range("B2:F6").Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = xlAutomatic .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = xlAutomatic .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = xlAutomatic .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = xlAutomatic .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = xlAutomatic .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = xlAutomatic .TintAndShade = 0 .Weight = xlThin End Withのようになります。 しかし、このように上下左右すべて同じならば、もっと簡単に引くことができます。 Range("B2:F6").Borders.LineStyle = xlContinuous |
「こだわりハウス」写真館| 数学公式集| ピンポイントストリートビュー| FaceBook| Excel Vba テクニック集| Excel 計算式解析・他解析| 富山の建築家| Excel 計算式解析・他解析| 積分の定義・積分の記号の意味の研究| |