印刷範囲の設定・解除(PageSetup.PrintArea プロパティ)
PageSetup.PrintArea プロパティ
印刷範囲を設定するには、PageSetup オブジェクト の PrintArea プロパティ に、セル範囲( A1 形式の文字列)を指定します。設定をクリアするには、””(空文字)を指定します。PageSetup.PrintArea プロパティ は、取得および設定が可能です。
<取得>
object.PageSetup.PrintArea
<設定>
object.PageSetup.PrintArea = string
引数・戻り値
- object ・・・ 対象となる Worksheet オブジェクト を指定します。
- string ・・・ 印刷範囲を A1 形式の文字列で設定します。印刷範囲をクリアする場合は、””(空文字)を指定します。
PageSetup.PrintArea プロパティ 使用例
サンプルVBAソース
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Sub Sample_PageSetupPrintArea() Dim w As Worksheet Set w = ActiveSheet With w '印刷範囲を設定 .PageSetup.PrintArea = Range("B3").CurrentRegion.Address '印刷プレビューを表示 .PrintPreview End With End Sub |
実行結果
サンプルVBAソース 実行前
実行後
関連記事
-
-
ウィンドウを拡大・縮小(Zoom プロパティ)
ウィンドウを拡大・縮小(Zoom プロパティ) ウィンドウの表示サイズをパーセン …
-
-
ワークシートのコピー・移動(Copy メソッド Move メソッド)
Copy メソッド Copy メソッドで、指定した位置にワークシートの複製を作成 …
-
-
数式を表示(DisplayFormulas プロパティ)
数式を表示(DisplayFormulas プロパティ) セルに数式が入力されて …
-
-
白黒印刷(PageSetup.BlackAndWhite プロパティ)
PageSetup.BlackAndWhite プロパティ PageSetup. …
-
-
最近使用したファイル(RecentFile オブジェクト,RecentFiles コレクション)
最近使用したファイル(RecentFile オブジェクト,RecentFiles …
-
-
印刷設定(先頭ページのヘッダー・フッターを設定)DifferentFirstPageHeaderFooter, FirstPage
先頭ページに別のヘッダーおよびフッターを設定 先頭ページのヘッダーおよびフッター …
-
-
共有ファイルを開いているユーザー情報を取得(UserStatus プロパティ)
共有ファイルを開いているユーザー情報を取得 UserStatus プロパティは、 …
-
-
印刷のタイトル行、タイトル列を設定(PrintTitleRows,PrintTitleColumns)
PageSetup.PrintTitleRows プロパティ PageSetup …
-
-
印刷:余白を設定 TopMargin,BottomMargin,LeftMargin,RightMargin,HeaderMargin,FooterMargin
余白を設定する 余白を設定する単位は、pt(ポイント:約 0.03528 cm) …
-
-
枠線の表示・非表示の設定(DisplayGridlines プロパティ)
枠線の表示・非表示の設定 枠線の表示・非表示を設定するには、DisplayGri …

