• ベストアンサー

EXCEL97で印刷がB4になってしまう!

エクセルで横長の表を作成しました。 多少大き目なので印刷範囲を指定し、ページ設定で「拡大縮小印刷」で横1×縦1ページを選択しました。用紙サイズもA4を指定しました。(その結果縮小率は91%となります。) ところが印刷をかけると自動的にB4になってしまうのです。プリンターにはB4用紙を入れていませんので毎回印刷エラーになってしまいます。(B4用紙を入れればOK) そこでVBAでやってみようと、下記のようにしてみました。 Sub 表印刷() With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.590551181102362) .RightMargin = Application.InchesToPoints(0.590551181102362) .TopMargin = Application.InchesToPoints(0.118110236220472) .BottomMargin = Application.InchesToPoints(0.118110236220472) .HeaderMargin = Application.InchesToPoints(0) .FooterMargin = Application.InchesToPoints(0) .PrintHeadings = False .PrintGridlines = False .CenterHorizontally = True .CenterVertically = True .Orientation = xlLandscape .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End Sub しかしこれでやっても同じ結果でした。 なお、同ブックの他のページの表は正常に縮小印刷ができます。 原因と対策がまったくわからず困っています。 お助けください。

質問者が選んだベストアンサー

  • ベストアンサー
回答No.1

マクロも全然問題ないし、当然、印刷の設定方法もあってますので、可能性としてはプリンタの設定ではないでしょうか? プリンターのプロパティを見てください。 用紙はA4でも出力がB4で勝手に設定されてしまうことがたまにあります。経験済(笑)

AQUALINE
質問者

お礼

さっそくありがとうございます。 やはりご指摘のとおりプリンターのプロパティでした!! 変えた覚えはないのですがいつのまにかB4に変わっていました。 助かりました。ありがとうございます。

その他の回答 (1)

  • yuhzohsan
  • ベストアンサー率38% (92/237)
回答No.2

単純な回答だけど 「ファィル」の「ページ設定」の「用紙サイズ」が「B4」になっていないかなぁ」 とこういう事ですが…

AQUALINE
質問者

お礼

ありがとうございます。 もちろんファイルのページ設定はA4ですよ~。(笑) だから変だと質問したのです。

関連するQ&A

  • Excel2003VBA 印刷設定

    お世話になります。 下記、手入力による(?)印刷設定のコードなのですが不要な行をご教示いただきたく投稿致しました。 ・設定した内容は上下左右の余白を「0」にした。 ・用紙サイズと向きを選択した。 ・「1ページにあわせる」ように設定をした。 だけなのですが、恐らく単なる「マクロ記録」を利用したので余計な記述も含まれていると思います。 すでに削除してありますが 上から4行ほど何かを「""」という設定があったので 「勘」で削除し 動作確認ではOKでした。 でも見れば見るほど迷いが生じ どなたか ご存知の方にご教示いただこうと投稿致しました。 不要な行をご教示ください。 宜しくお願い致します。 Sub 印刷設定_A3横() ' ' 印刷設定_A3横 Macro ' マクロ記録日 : 2009/5/14 ' ' With ActiveSheet.PageSetup .LeftMargin = Application.InchesToPoints(1) .RightMargin = Application.InchesToPoints(0) .TopMargin = Application.InchesToPoints(0) .BottomMargin = Application.InchesToPoints(0) .HeaderMargin = Application.InchesToPoints(0.511811023622047) .FooterMargin = Application.InchesToPoints(0.511811023622047) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperA3 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .PrintErrors = xlPrintErrorsDisplayed End With ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=True, Collate:= _ True End Sub

  • エクセルのマクロについて

    エクセルの印刷マクロを作りましたが、動作が非常に遅いのです。 スタッフ用と管理者用のマクロを作り、スタッフ用が遅いのです。 余計なものが含まれているのでしょうか? お願いします。 Sub スタッフ() ' スタッフ Macro   ActiveSheet.PageSetup.PrintArea = "$A$1:$AJ$55" With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "$A$1:$AJ$55" With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0) .RightMargin = Application.InchesToPoints(0) .TopMargin = Application.InchesToPoints(0) .BottomMargin = Application.InchesToPoints(0) .HeaderMargin = Application.InchesToPoints(0) .FooterMargin = Application.InchesToPoints(0) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .CenterHorizontally = True .CenterVertically = True .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = 76 .PrintErrors = xlPrintErrorsDisplayed End With ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True ActiveSheet.PageSetup.PrintArea = "$A$1:$AJ$60" With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "$A$1:$AJ$60" With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0) .RightMargin = Application.InchesToPoints(0) .TopMargin = Application.InchesToPoints(0) .BottomMargin = Application.InchesToPoints(0) .HeaderMargin = Application.InchesToPoints(0) .FooterMargin = Application.InchesToPoints(0) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .CenterHorizontally = True .CenterVertically = True .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = 70 .PrintErrors = xlPrintErrorsDisplayed End With Range("A1").Select End Sub

  • EXCELで印刷範囲指定

    マクロの記録で印刷範囲の指定を考えています。 以下のマクロを記録しました。 Sub 印刷範囲指定() Cells.Select With Selection.Font .Name = "MS Pゴシック" .Size = 9 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Range("A1").Select With ActiveSheet.PageSetup .PrintTitleRows = "$6:$8" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "&A" .RightHeader = "" .LeftFooter = "" .CenterFooter = "&P / &N ページ" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.78740157480315) .RightMargin = Application.InchesToPoints(0.78740157480315) .TopMargin = Application.InchesToPoints(0.984251968503937) .BottomMargin = Application.InchesToPoints(0.984251968503937) .HeaderMargin = Application.InchesToPoints(0.511811023622047) .FooterMargin = Application.InchesToPoints(0.511811023622047) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = 100 End With ActiveWindow.View = xlPageBreakPreview ActiveWindow.LargeScroll ToRight:=1 ActiveSheet.PageSetup.PrintArea = "$A$1:$I$50" ActiveWindow.View = xlNormalView Columns("B:I").Select Columns("B:I").EntireColumn.AutoFit Range("A1").Select End Sub やりたいことは ・まず最初にcsvファイルをxlsファイルに取り込む機能をつけたい。 ・取り込んだcsvをシートの一番最後につける。 そのファイルを以下のように設定していきたいです。 ・列の印刷範囲を数ある列のうちA列からI列までとする。 ・行の印刷範囲をA列の最終行までとしたい。 上記マクロでここを修正すればいいというところがあれば教えてください。。

  • Excelでのページ番号付与について(WindowsXP)

    Excelでのページ番号付与について(WindowsXP) 何枚かのシートがあるファイルに一括でヘッダー・フッターを付けたいと思っています。 Sub SetHeader() Dim mySheet As Worksheet Application.ScreenUpdating = False For Each mySheet In ActiveWindow.SelectedSheets With mySheet.PageSetup .LeftHeader = "左ヘッダー" .CenterHeader = "中央ヘッダー" .RightHeader = "右ヘッダー" .LeftFooter = "左フッター" .CenterFooter = "中央フッター" .RightFooter = "右フッター" End With Next Application.ScreenUpdating = True End Sub 上記のようにマクロを作成したのですが、選択したシートの連番という単純な物ではなく ちょっと面倒なページ表示をしなければいけなくなりました。 一つのファイルの中で 1シート目→1ページ 2シート目→3ページ 3シート目→2ページ などとなっている場合 1枚目→1 2枚目→2-1/3    2-2/3    2-3/3 3枚目→3-1/2    3-2/2 というようなページ表示にしたいのですが、どのようにマクロを組めばいいかわからなくて困っています。 よろしくお願いいたします。  

  • 【Excel2013マクロ】コメント「なし」

    ググったところ同じ質問があったものの解決していないようなので、再度質問させていただきます。 過去の質問 → https://oshiete.goo.ne.jp/qa/9365077.html Excel2010からコピーしてきたページ設定のマクロを実行すると、コメント(M)が2010では「(なし)」だったのが2013では「シートの末尾」に設定されてしまいます。 「(なし)」でマクロを作り直してもダメです。 ------------------------------------- Application.PrintCommunication = False With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With Application.PrintCommunication = True ActiveSheet.PageSetup.PrintArea = "" Application.PrintCommunication = False With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.78740157480315) .RightMargin = Application.InchesToPoints(0.393700787401575) .TopMargin = Application.InchesToPoints(0.393700787401575) .BottomMargin = Application.InchesToPoints(0.393700787401575) .HeaderMargin = Application.InchesToPoints(0) .FooterMargin = Application.InchesToPoints(0) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlPortrait .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = False .PrintErrors = xlPrintErrorsBlank .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .ScaleWithDocHeaderFooter = True .AlignMarginsHeaderFooter = True .EvenPage.LeftHeader.Text = "" .EvenPage.CenterHeader.Text = "" .EvenPage.RightHeader.Text = "" .EvenPage.LeftFooter.Text = "" .EvenPage.CenterFooter.Text = "" .EvenPage.RightFooter.Text = "" .FirstPage.LeftHeader.Text = "" .FirstPage.CenterHeader.Text = "" .FirstPage.RightHeader.Text = "" .FirstPage.LeftFooter.Text = "" .FirstPage.CenterFooter.Text = "" .FirstPage.RightFooter.Text = "" End With Application.PrintCommunication = True End Sub ------------------------------------- 「(なし)」にする方法はありませんか?

  • VBAの印刷について

    VBAでの質問です。 ある処理を施したあとにページ設定をして印刷するプログラムを作成しているのですが、なぜか同じものが2枚出力されてしまいます。 1枚だけ指定して印刷するにはどのようにコードを書けば良いかどなたか教えて下さい。お願いします。 With ActiveSheet.PageSetup 'ページ詳細設定 .PaperSize = xlPaperA4 .Zoom = False .FitToPagesTall = 1       .FitToPagesWide = 1     End With 'ActiveSheet.PrintOut Worksheets(sheetname5).PrintOut ActiveWorkbook.SaveAs Filename:=takiicode & "_" & Format(today, "yyyymmdd") & ".xls" '保存) Workbooks(takiicode & "_" & Format(today, "yyyymmdd") & ".xls").Close SaveChanges:=True '終了

  • ヘッダーのタイトルとページ表示のコードがわからない

    表のタイトルと日付、ページをヘッダーあるいはフッダーに入れたいのですが うまく表示されません。 1.左ヘッダーに【名古屋市】登録状までしか表示しません。  【名古屋市】登録状況一覧 と表示させたいです。 2.日付は出てきたのですが、作表した日付のままでしょうか?  次の日に印刷したら日付がかわるのでしょうか?  システムからダウンロードした日付をいつも表示するようにしたいです。 3.1/しか表示しません。総ページ数が表示されません。 間違っているところを指摘していただけないでしょうか? よろしくお願いします。 With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftHeader = "&""MS Pゴシック,太字""&20【&A】登録状況一覧" .CenterHeader = "" .RightHeader = Format(Date, "ggge年m月d日") & "現在" '日付 .LeftFooter = "" .CenterFooter = "&P/&N" .RightFooter = "" End With

  • EXCEL VBAでシートの余白を統一したい。

    こんばんは。 EXCEL VBAでひとつのファイルの中のすべてのシートの余白とA4横サイズに統一したいのです。 マクロの記録をとると With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.393700787401575) .RightMargin = Application.InchesToPoints(0.393700787401575) .TopMargin = Application.InchesToPoints(0.393700787401575) .BottomMargin = Application.InchesToPoints(0.393700787401575) .HeaderMargin = Application.InchesToPoints(0) .FooterMargin = Application.InchesToPoints(0) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = 100 .PrintErrors = xlPrintErrorsDisplayed End With End Sub このように記述されますが、どのように加工したらよろしいでしょうか? 教えてください。

  • ヘッダーの編集でフォントの設定をした場合は

    マクロの記録で ページ設定→ヘッダーフッター→ヘッダーの編集でフォントの設定をした場合は この設定のマクロの記録は取れないのでしょうか? マクロの記録の結果を見ても Sub Macro1() ' ' Macro11 Macro ' ' Application.PrintCommunication = False With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With Application.PrintCommunication = True ActiveSheet.PageSetup.PrintArea = "" Application.PrintCommunication = False With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "あああ" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.590551181102362) .RightMargin = Application.InchesToPoints(0.590551181102362) .TopMargin = Application.InchesToPoints(0.78740157480315) .BottomMargin = Application.InchesToPoints(0) .HeaderMargin = Application.InchesToPoints(0) .FooterMargin = Application.InchesToPoints(0) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlPortrait .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = 100 .PrintErrors = xlPrintErrorsDisplayed .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .ScaleWithDocHeaderFooter = True .AlignMarginsHeaderFooter = True .EvenPage.LeftHeader.Text = "" .EvenPage.CenterHeader.Text = "" .EvenPage.RightHeader.Text = "" .EvenPage.LeftFooter.Text = "" .EvenPage.CenterFooter.Text = "" .EvenPage.RightFooter.Text = "" .FirstPage.LeftHeader.Text = "" .FirstPage.CenterHeader.Text = "" .FirstPage.RightHeader.Text = "" .FirstPage.LeftFooter.Text = "" .FirstPage.CenterFooter.Text = "" .FirstPage.RightFooter.Text = "" End With Application.PrintCommunication = True End Sub で、フォントの設定は見当たりません。

  • Excel2010のVBAでライトヘッダーが出ない

    2020/10/12 OKウェイヴ 質問 Excel2010にて、VBAで以下を実行すると ライトヘッダーの日付が印刷されません。 ライトヘッダーの日付が出力されるようにするには どの部分をどのように修正する必要があるでしょうか。 日付が表示されない理由、表示されるようになるための修正点を教えていただきますようお願いします。 ※初心者が記録されたマクロを修正しただけなので コードが汚いなどは気にしないでください。 また、テキスト部分は内容を修正してあります。 Cells(1, 1).Select Application.PrintCommunication = False Worksheets(Worksheets.Count).Copy After:=Worksheets(Worksheets.Count) With ActiveSheet.PageSetup .RightHeader = "&""メイリオ,レギュラー""&D" .LeftFooter = "&""メイリオ,レギュラー""テキスト" & vbLf & "テキスト" .RightFooter = "&""メイリオ,レギュラー""テキスト" & vbLf & "テキスト" & vbLf & "テキスト" .LeftMargin = Application.InchesToPoints(0.984251968503937) .RightMargin = Application.InchesToPoints(0.984251968503937) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1.18110236220472) .HeaderMargin = Application.InchesToPoints(0.511811023622047) .FooterMargin = Application.InchesToPoints(0.4) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = True .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = False .PrintErrors = xlPrintErrorsDisplayed .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .ScaleWithDocHeaderFooter = True .AlignMarginsHeaderFooter = True .PrintTitleRows = "$1:$1" End With Range("U:U").AdvancedFilter Action:=xlFilterCopy, copytorange:=Range("ZZ1"), Unique:=True Range("A1").AutoFilter Field:=17, Criteria1:="<>" Range("A1", Selection.End(xlToRight)).EntireColumn.AutoFit Selection.ShrinkToFit = True Range("A:L,N:P,R:V,ZZ:ZZ").EntireColumn.Hidden = True Range("A1", Selection.End(xlToRight)).EntireColumn.Select ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address With Selection.Font .Name = "Meiryo UI" .Size = 11 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ThemeColor = xlThemeColorLight1 .TintAndShade = 0 .ThemeFont = xlThemeFontNone End With Rows("1:1").Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Dim i As Integer i = 2 Do While Cells(i, "ZZ") <> "" Range("A1").AutoFilter Field:=21, Criteria1:=Cells(i, "ZZ") If Cells(Rows.Count, "Q").End(xlUp) <> "参照先" Then ActiveSheet.PageSetup.LeftHeader = "&""メイリオ,レギュラー""" & Cells(Rows.Count, "U").End(xlUp) & "テキスト" & vbLf & "テキスト" Application.PrintCommunication = True ActiveSheet.PrintOut Application.PrintCommunication = False End If i = i + 1 Loop Range("B2").Select End Sub

専門家に質問してみよう