印刷する用紙の向きを設定(PageSetup.Orientation プロパティ)
PageSetup.Orientation プロパティ
PageSetup.Orientation プロパティで、印刷する用紙の向きを設定することができます。値の取得および設定が可能で、XlPageOrientation 列挙型 の定数を使用します。
<取得>
object.PageSetup.Orientation
<設定>
object.PageSetup.Orientation = const
引数・戻り値
- object ・・・ 対象となる Worksheet オブジェクト を指定します。
- const ・・・ 印刷用紙の向きが縦か横を表す XlPageOrientation 列挙型 の定数またはその値を指定します。
定数 値 内容 xlPortrait 1 用紙の向きを縦に設定 xlLandscape 2 用紙の向きを横に設定
PageSetup.Orientation プロパティ 使用例
サンプルVBAソース
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Sub Sample_Orientation() Dim w As Worksheet Set w = ActiveSheet '用紙の向きを横向きに設定 w.PageSetup.Orientation = xlLandscape '印刷プレビューを表示 w.PrintPreview End Sub |
実行結果
関連記事
-
-
分割したウィンドウの取得(Panes コレクション,Pane オブジェクト)
分割したウィンドウ 「ウィンドウ枠の固定」や「ウィンドウの分割」での、すべての領 …
-
-
再計算(Calculation, EnableCalculation, Calculate)
ワークブックやシートの再計算 通常、Excel では、自動的に再計算が行われる設 …
-
-
ウィンドウを拡大・縮小(Zoom プロパティ)
ウィンドウを拡大・縮小(Zoom プロパティ) ウィンドウの表示サイズをパーセン …
-
-
ユーザー設定のビュー(CustomView オブジェクト)
ユーザー設定のビュー CustomView オブジェクトは、登録されている各ビュ …
-
-
スクロール範囲を限定(ScrollArea プロパティ)
ScrollArea プロパティ ScrollArea プロパティ にセル範囲を …
-
-
ウィンドウのタイトル(Window.Caption プロパティ)
ウィンドウのタイトル(Caption プロパティ) Windows.Captio …
-
-
印刷:余白を設定 TopMargin,BottomMargin,LeftMargin,RightMargin,HeaderMargin,FooterMargin
余白を設定する 余白を設定する単位は、pt(ポイント:約 0.03528 cm) …
-
-
シート見出しの色を設定(Tab プロパティ)
シート見出しの色を設定 Tab オブジェクトの Color プロパティ、Colo …
-
-
ブックの表示・非表示(Visible プロパティ)
ブック表示・非表示(Visible プロパティ) ブック(ウィンドウ)が表示され …
-
-
印刷設定を高速化(PrintCommunication プロパティ)
PrintCommunication プロパティ PrintCommunicat …
