★すっきりした罫線のプログラム!
Sub 罫線を引くぜ()
  Range("B2:D8").Select
  
With Selection.Borders(xlEdgeLeft)
    .LineStyle = xlContinuous
    .Weight = xlThin
  
End With
  
With Selection.Borders(xlEdgeTop)
    .LineStyle = xlContinuous
    .Weight = xlThin
  
End With
  
With Selection.Borders(xlEdgeBottom)
    .LineStyle = xlContinuous
    .Weight = xlThin
  
End With
  
With Selection.Borders(xlEdgeRight)
    .LineStyle = xlContinuous
    .Weight = xlThin
  
End With
  
With Selection.Borders(xlInsideVertical)
    .LineStyle = xlContinuous
    .Weight = xlHairline
  
End With
  
With Selection.Borders(xlInsideHorizontal)
    .LineStyle = xlContinuous
    .Weight = xlHairline
  
End With
  Range("B2:D2").Select
  
With Selection.Borders(xlEdgeLeft)
    .LineStyle = xlContinuous
    .Weight = xlThin
  
End With
  
With Selection.Borders(xlEdgeTop)
    .LineStyle = xlContinuous
    .Weight = xlThin
  
End With
  
With Selection.Borders(xlEdgeBottom)
    .LineStyle = xlDouble
    .Weight = xlThick
  
End With
  
With Selection.Borders(xlEdgeRight)
    .LineStyle = xlContinuous
    .Weight = xlThin
  
End With
  
With Selection.Borders(xlInsideVertical)
    .LineStyle = xlContinuous
    .Weight = xlHairline
  
End With
  Range("B7:D7").Select
  
With Selection.Borders(xlEdgeLeft)
    .LineStyle = xlContinuous
    .Weight = xlThin
  
End With
  
With Selection.Borders(xlEdgeTop)
    .LineStyle = xlContinuous
    .Weight = xlHairline
  
End With
  
With Selection.Borders(xlEdgeBottom)
    .LineStyle = xlDouble
    .Weight = xlThick
  
End With
  
With Selection.Borders(xlEdgeRight)
    .LineStyle = xlContinuous
    .Weight = xlThin
  
End With
  
With Selection.Borders(xlInsideVertical)
    .LineStyle = xlContinuous
    .Weight = xlHairline
  
End With
  Range("D8").Select
End Sub

 かなりすっきりしましたね。いかがですか?
私的には、不要なプログラムは削除できましたが、何が書いてあるのか分かりにくいので、これにコメントを入れてみたいと思います。

コメントは ( ' )シングルクォーテーションからはじめます。

[トップ][前へ][罫線マクロのコード][次へ]