|
コマンドボタンクリックイベント
Private Sub CommandButton1_Click()
'印刷範囲
Sheets("Sheet2").PageSetup.PrintArea = "A5:I9"
'用紙サイズ
Sheets("Sheet2").PageSetup.PaperSize = xlPaperA4
'用紙方向
Sheets("Sheet2").PageSetup.Orientation = xlLandscape
'余白 センチをポイントに変換しセット
Sheets("Sheet2").PageSetup.LeftMargin = Application.CentimetersToPoints(1)
Sheets("Sheet2").PageSetup.RightMargin = Application.CentimetersToPoints(0.6)
Sheets("Sheet2").PageSetup.TopMargin = Application.CentimetersToPoints(1.8)
Sheets("Sheet2").PageSetup.BottomMargin = Application.CentimetersToPoints(1.1)
Sheets("Sheet2").PageSetup.HeaderMargin = Application.CentimetersToPoints(1)
Sheets("Sheet2").PageSetup.FooterMargin = Application.CentimetersToPoints(0.7)
'印刷プレビュー
Sheets("Sheet2").PrintPreview
End Sub |
|