メインコンテンツへスキップ

ExcelでXNUMXページに長い列を印刷するにはどうすればよいですか?

200列に5行程度の長いデータのリストがあり、それらを印刷する必要があると仮定しますが、印刷するときは、左側にXNUMX列だけで、多くの空白がある約XNUMXページの用紙を使用します。右側。 つまり、列を作成することはできますが、Excelにはこの機能がありません。 長いリストのデータをXNUMXページに印刷して、紙を節約するにはどうすればよいですか。

式を使用してXNUMXページに長い列を印刷する

VBAコードを使用してXNUMXページに長い列を印刷する

Kutools forExcelを使用してXNUMXページに長い列を印刷する


矢印青い右バブル 式を使用してXNUMXページに長い列を印刷する

ここでは、この問題を解決するための長い公式を紹介します。次のようにしてください。

1。 アクティブなブックの新しいワークシートに、数式を入力します =IF(OFFSET(Sheet1!$A$1,(COLUMN()-1)*45+ROW()-1,0)="","",OFFSET(Sheet1!$A$1,(COLUMN()-1)*45+ROW()-1,0)) セルA1に。

ノート: Sheet1 列にしたい長いリストがあるワークシートです。

45 列にデータをリストする行番号です。

これらはすべて変数であり、必要に応じて変更できます。

2。 次に、セルA1を選択し、塗りつぶしハンドルを行45までドラッグしてから、データが表示されるまで塗りつぶしハンドルを右にドラッグし続けます。 また、長い列は、新しいワークシートのXNUMXページに収まるように、いくつかの列に分割されています。 スクリーンショットを参照してください:

doc-print-long-column1


矢印青い右バブル VBAコードを使用してXNUMXページに長い列を印刷する

次のVBAコードは、データの長いリストを複数の列に分割して、データを印刷して紙を節約するのにも役立ちます。

1。 を押し続けます Alt + F11 キー、そしてそれは開きます アプリケーション向け Microsoft Visual Basic 窓。

2に設定します。 OK をクリックします。 インセット > モジュール、モジュールウィンドウに次のコードを貼り付けます。

Sub SingleToMultiColumn()
    Dim rng As Range
    Dim iCols As Integer
    Dim lRows As Long
    Dim iCol As Integer
    Dim lRow As Long
    Dim lRowSource As Long
    Dim x As Long
    Dim wks As Worksheet
    Set rng = Application.InputBox _
      (prompt:="Select the range to convert", _
      Type:=8)
    iCols = InputBox("How many columns do you want?")
    lRowSource = rng.Rows.Count
    lRows = lRowSource / iCols
    If lRows * iCols <> lRowSource Then lRows = lRows + 1
    Set wks = Worksheets.Add
    lRow = 1
    x = 1
    For iCol = 1 To iCols
        Do While x <= lRows And lRow <= lRowSource
            Cells(x, iCol) = rng.Cells(lRow, 1)
            x = x + 1
            lRow = lRow + 1
        Loop
        x = 1
    Next
End Sub

3。 次に、 F5 キーを押してこのコードを実行し、ポップアップダイアログボックスで分割するリストデータを選択します。スクリーンショットを参照してください。

doc-print-long-column2

4に設定します。 OK をクリックします。 OK、および分割する列の数を入力します。 スクリーンショットを参照してください:

doc-print-long-column3

5。 をクリックします OK、新しいワークシートでは、長い列がXNUMXつの列に分割されています。 スクリーンショットを参照してください:

doc-print-long-column4 -2 doc-print-long-column5

矢印青い右バブル Kutools forExcelを使用してXNUMXページに長い列を印刷する

長い式とVBAコードの両方が難しい場合があります。ここでは、この問題を解決するための簡単で便利な方法を紹介します。 Kutools for Excelさん 複数の列を印刷する 関数を使用すると、長い列を複数の列にすばやく分割して、合理的に印刷できるようになります。

Kutools for Excel 300以上の便利なExcelツールが含まれています。 30日以内に制限なしで無料でお試しいただけます。 今すぐ入手.

Kutools for Excelをインストールしたら、次の手順で実行できます。

1に設定します。 OK をクリックします。 Enterprise > 複数の列を印刷する、スクリーンショットを参照してください:

doc-print-long-column6

2。 の中に 複数の列を印刷する ダイアログボックス:

  • 最初のクリック ドキュメントボタン ボタンをクリックして範囲のタイトルを選択し、XNUMX番目をクリックします ドキュメントボタンボタンをクリックして、分割する列を選択します。
  • 次に、ページごとに配置する行数を指定します。 印刷ページあたりの行数、およびXNUMXページに必要な列数を下に入力します セグメント数。 スクリーンショットを参照してください:

doc-print-long-column7

3。 次に、をクリックします OK、ロングリストデータはXNUMXページでXNUMX列に分割されています。 スクリーンショットを参照してください:

doc-print-long-column8 -2 doc-print-long-column9

注意:

1.タイトルはすべての列の前に追加されます。

2.チェックした場合 アクティブシートとのリンクを作成する オプションで、新しいワークシートデータをソースデータにリンクできます。

この機能について詳しく知りたい場合は、をクリックしてください。 複数の列を印刷する.

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (14)
Rated 4.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
I have a column of 10,000 unique numbers, all sorted. The VBA code provides a table, but the Columns are sorted individually.
I would prefer that each page is sorted numerically so easy to follow the data page by page. Any suggestions most welcome.
Keith
This comment was minimized by the moderator on the site
Hello, Paterson,
Maybe the following VBA code can do you a favor:
Sub SingleToMultiColumn()
    Dim xRng As Range
    Dim xCount As Integer
    Dim xICols As Integer
    Dim xLRows As Long
    Dim xICol As Integer
    Dim xLRow As Long
    Dim xLRowSource As Long
    Dim xRowNum As Long
    Dim xFCount, xFNum, xFNum_R, xFNum_C As Long
    Dim x As Long
    Dim xWst As Worksheet
    Dim xJ As Integer
    
    Set xRng = Application.InputBox(prompt:="Select the range to convert", Type:=8)
    xICols = InputBox("How many columns do you want?")
    xRowNum = InputBox("How many rows do you want in a page?")
    xCount = xRng.Count
    xFCount = Fix(xCount / (xICols * xRowNum))
    If xICols * xRowNum * xFCount < xCount Then xFCount = xFCount + 1
    Set xWst = Worksheets.Add
    xJ = 0
    Application.ScreenUpdating = False
    For xFNum = 1 To xFCount
        If xJ = xCount Then Exit For
        For xFNum_C = 1 To xICols
            If xJ = xCount Then Exit For
            For xFNum_R = 1 To xRowNum
                If xJ = xCount Then Exit For
                xWst.Cells((xFNum - 1) * xRowNum + xFNum_R, xFNum_C) = xRng.Item(xJ + 1)
                xJ = xJ + 1
            Next
        Next
    Next
     Application.ScreenUpdating = True
End Sub



Please try, hope it can help you!
This comment was minimized by the moderator on the site
I have a column of 10,000 numbers and the VBA macro will provide a table on several pages. However, I would prefer that each page is sorted numerically rather than the column. Any help appreciated.
This comment was minimized by the moderator on the site
Or you can just copy the table, and paste it in a word document, with as many columns you want to have.
This comment was minimized by the moderator on the site
Thank you! The formula worked seamlessly!
This comment was minimized by the moderator on the site
You can use a simple formula =OFFSET(Sheet1!$A$1,(ROW()-2)*5+COLUMN(),0) to let the data flow horizontally in 5 columns. Then you can select Page size, print first row on each page, etc. Simple, neat, no VBA
This comment was minimized by the moderator on the site
where does this formula go? I am trying to print multiple rows with several columns on one page in a multiple row layout. Similar to this:

john smith week 1
john smith week 2
john smith totals


I have over 100 rows with up to IJ
This comment was minimized by the moderator on the site
Is there a way to modify this formula to work with 3 columns instead of 1?
This comment was minimized by the moderator on the site
Modern Excel (e.g. 365) can use this for single column:
=WRAPCOLS(Sheet1!$A$1:$A$50;45;"")

Similarly, if you want the column spread horizontally use:
=WRAPROWS(Sheet1!$A$1:$A$50;3;"")


If you need multiple columns converted, I created this formula:
=LET(SOURCE;Sheet1!$A$1;R;45;C;3;X;MOD(COLUMN()-1;C);NEW_REL_COL;INT((COLUMN()-1)/C);Y;(NEW_REL_COL)*R+ROW()-1;V;OFFSET(SOURCE;Y;X);IF(OR(V="";ROW()>R);"";V))

Update SOURCE (Sheet1!$A$1) to be the top-left corner of your source, the number behind R (45) for the rows; the number behind C (3) for the columns of your source.

e.g. for output of 2 columns with 30 rows start the formula with =LET(SOURCE;Sheet1!$A$1;R;30;C;2;


On modern Excel (e.g. 365) can use this Spill-Function for multicolumn with an added empty column in between:

=LET(R;45;C;3;EMPTY_COL;TRUE;
E;IF(EMPTY_COL;1;0);ANZ;COUNTA(Sheet1!$A:$A);MY;R;MX;CEILING.MATH(ANZ/MY;1)*(C+E);
MAKEARRAY(MY;MX;LAMBDA(ru;co;
LET(X;MOD(co-1;(C+E));NEW_REL_COL;INT((co-1)/(C+E));Y;(NEW_REL_COL)*R+ru-1;
IF(OR(AND(EMPTY_COL;X=(C+E-1));Y>=ANZ);"";OFFSET(Sheet1!$A$1;Y;X))
))))

Needs to be filled only in one cell and fills out down and right.
Use R and C like above. Fill the value EMPTY_COL with true or false if you want an empty column to be added between the repetitions.
Rated 4.5 out of 5
This comment was minimized by the moderator on the site
I would be interested in a solution like this as well.
This comment was minimized by the moderator on the site
Dear Sir Thanks for this work, This VBA Code is very helpful for my work, I am glad to complete my task in seconds. Thank You. ....
This comment was minimized by the moderator on the site
After searching the internet for hours, I stumbled across this. Its exactly what I was looking for. Nice job and thanks for taking the time out for this.
This comment was minimized by the moderator on the site
Thank you for this information! It was very helpful and easy to use - even for somebody lacking strong computer skills (I used the first method)
This comment was minimized by the moderator on the site
Hello, I have a question related to the second option "Print long column on one page with VBA code". If i have more than one column in range how can I use the same code. Let say the range of "$A$2:$C$118" how can i do it work. Thanks.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations