Menuへ
印刷設定・印刷プレビュー



シートコード
コマンドボタンクリックイベント

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

実行結果
開始コマンドボタン

印刷対象データ


実行結果の印刷プレビュー



Topへ