印刷時、シート内のエラーをどう扱うかを設定(PrintErrors プロパティ)
PageSetup.PrintErrors プロパティ
PageSetup.PrintErrors プロパティで、ワークシート内に表示されたエラーを印刷するときに、どのように扱うかを設定することができます。設定には、XlPrintErrors 列挙型 の定数を使用します。値の取得および設定が可能です。
<取得>
object.PageSetup.PrintErrors
<設定>
object.PageSetup.PrintErrors = const
引数・戻り値
- object ・・・ 対象となる Worksheet オブジェクト を指定します。
- const ・・・ 印刷時、エラーをどのように扱うかを表す XlPrintErrors 列挙型 の定数またはその値を指定します。
定数 値 内容 xlPrintErrorsDisplayed 0 表示されている通りに印刷されます xlPrintErrorsBlank 1 エラーは印刷されません xlPrintErrorsDash 2 エラー部分には ダッシュ(–)が印刷されます xlPrintErrorsNA 3 エラー部分には 無効(#N/A)が印刷されます
PageSetup.PrintErrors プロパティ 使用例
サンプルVBAソース
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Sub Sample_PrintErrors() Dim w As Worksheet Set w = ActiveSheet 'エラーを「ダッシュ(--)」で表示します w.PageSetup.PrintErrors = xlPrintErrorsDash '印刷プレビューを表示 w.PrintPreview End Sub |
実行結果
関連記事
-
ブックが互換モードで開いているか確認する(Excel8CompatibilityMode プロパティ)
ブックが互換モードで開いているか確認する Excel8Compatibility …
-
印刷設定(ページごとに異なるヘッダー・フッターを設定)Page オブジェクト・HeaderFooter オブジェクト
Page オブジェクト ページごとに異なるヘッダーおよびフッターを設定する場合、 …
-
印刷の倍率(拡大/縮小)(PageSetup.Zoom プロパティ)
PageSetup.Zoom プロパティ PageSetup.Zoom プロパテ …
-
ブック・シートの名前を取得・設定(Name プロパティ)
ワークブックの名前を取得 Name プロパティで、ワークブックの名前を取得します …
-
印刷の先頭のページ番号を設定(PageSetup.FirstPageNumber プロパティ)
PageSetup.FirstPageNumber プロパティ PageSetu …
-
印刷位置を中央に設定(CenterHorizontally, CenterVertically)
PageSetup.CenterHorizontally プロパティ PageS …
-
ブックのプロパティ(BuiltinDocumentProperties プロパティ)
BuiltinDocumentProperties プロパティ ブックのプロパテ …
-
シートを保護・保護したシートを解除する(Protect メソッド・Unprotect メソッド)
Protect メソッド・Unprotect メソッド Protect メソッド …
-
印刷設定を高速化(PrintCommunication プロパティ)
PrintCommunication プロパティ PrintCommunicat …
-
印刷のタイトル行、タイトル列を設定(PrintTitleRows,PrintTitleColumns)
PageSetup.PrintTitleRows プロパティ PageSetup …