作成日 : 2007/10/30 H.Naito
更新日 : 2007/11/01 H.Naito



幅が3.0の新しいシートを右側に追加する

Sub シート追加()
' 一番後ろにシートを追加する
Range("A1").Select
Sheets.Add After:=ActiveSheet
' 幅を3.0にする
Cells.Select
Selection.ColumnWidth = 3
Range("A1").Select
End Sub

クリップボードにある画像を50% に縮小して張り付ける

Sub 画像縮小()
ActiveSheet.Paste
Selection.ShapeRange.ScaleHeight 0.5, True
Selection.ShapeRange.ScaleWidth 0.5, True
End Sub

選択範囲の外側に実線、内側に点線を引く

Sub DwanLine()
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
 .LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
 .LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic 
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
End Sub


最終更新:2007年11月01日 17:10