印刷する用紙の向きを設定(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 |
実行結果
関連記事
-
-
ブックが共有モードか確認する(MultiUserEditing プロパティ)
ブックが共有モードか確認する(MultiUserEditing プロパティ) 共 …
-
-
WorksheetView オブジェクト
WorkSheetView オブジェクト 行列番号や枠線の表示・非表示の設定など …
-
-
ワークシートの数を数える(Count プロパティ)
Count プロパティ 指定したWorksheets コレクションやSheets …
-
-
印刷:余白を設定 TopMargin,BottomMargin,LeftMargin,RightMargin,HeaderMargin,FooterMargin
余白を設定する 余白を設定する単位は、pt(ポイント:約 0.03528 cm) …
-
-
印刷設定を高速化(PrintCommunication プロパティ)
PrintCommunication プロパティ PrintCommunicat …
-
-
再計算(Calculation, EnableCalculation, Calculate)
ワークブックやシートの再計算 通常、Excel では、自動的に再計算が行われる設 …
-
-
印刷設定(フッターに文字列を指定)LeftFooter,CenterFooter,RightFooter
PageSetup.LeftFooter プロパティ PageSetup.Lef …
-
-
ブックのプロパティ(BuiltinDocumentProperties プロパティ)
BuiltinDocumentProperties プロパティ ブックのプロパテ …
-
-
ブックが互換モードで開いているか確認する(Excel8CompatibilityMode プロパティ)
ブックが互換モードで開いているか確認する Excel8Compatibility …
-
-
Excel を全画面表示(DisplayFullScreen プロパティ)
DisplayFullScreen プロパティ DisplayFullScree …
