2012年 09月 12日
【管理人】内側は極細で、外側は普通の太さで罫線を引くExcelマクロ
|
ども、管理人です。
簡単エクセル3分クッキング第2弾。
Sub Keisen()
With Selection
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeTop).Weight = xlThin
.Borders(xlEdgeBottom).Weight = xlThin
.Borders(xlEdgeRight).Weight = xlThin
.Borders(xlEdgeLeft).Weight = xlThin
If Selection.Columns.Count > 1 Then
.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideVertical).Weight = xlHairline
End If
If Selection.rows.Count > 1 Then
.Borders(xlInsideHorizontal).Weight = xlHairline
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
End If
End With
End Sub
結果はこちら
簡単エクセル3分クッキング第2弾。
Sub Keisen()
With Selection
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeTop).Weight = xlThin
.Borders(xlEdgeBottom).Weight = xlThin
.Borders(xlEdgeRight).Weight = xlThin
.Borders(xlEdgeLeft).Weight = xlThin
If Selection.Columns.Count > 1 Then
.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideVertical).Weight = xlHairline
End If
If Selection.rows.Count > 1 Then
.Borders(xlInsideHorizontal).Weight = xlHairline
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
End If
End With
End Sub
結果はこちら
by kentts
| 2012-09-12 17:23
| 小ネタ