Loncat ke daftar isi utama

Bagaimana cara mencetak kolom panjang pada satu halaman di Excel?

Misalkan Anda memiliki daftar data yang panjang dalam satu kolom, mungkin 200 baris, dan sekarang Anda perlu mencetaknya, tetapi saat Anda mencetak, ini menggunakan kertas sekitar 5 halaman, dengan hanya satu kolom di sisi kiri, dan banyak ruang putih di sisi kanan. Singkatnya, Anda bisa membuat kolom, tapi Excel tidak memiliki fungsi ini. Bagaimana Anda mencetak data daftar panjang pada satu halaman untuk menghemat kertas?

Cetak kolom panjang pada satu halaman dengan rumus

Cetak kolom panjang pada satu halaman dengan kode VBA

Cetak kolom panjang di satu halaman dengan Kutools for Excel


panah gelembung kanan biru Cetak kolom panjang pada satu halaman dengan rumus

Di sini saya dapat memperkenalkan Anda rumus panjang untuk menyelesaikan masalah ini, lakukan seperti ini:

1. Di lembar kerja baru buku kerja aktif Anda, masukkan rumus =IF(OFFSET(Sheet1!$A$1,(COLUMN()-1)*45+ROW()-1,0)="","",OFFSET(Sheet1!$A$1,(COLUMN()-1)*45+ROW()-1,0)) ke dalam sel A1.

Catatan: Sheet1 adalah lembar kerja yang memiliki daftar panjang yang ingin Anda kolom.

45 adalah nomor baris yang ingin Anda daftarkan datanya dalam kolom.

Semuanya adalah variabel, dan Anda dapat mengubahnya sesuai kebutuhan.

2. Kemudian pilih sel A1, dan seret gagang isian ke bawah ke baris 45, lalu lanjutkan menyeret gagang isian ke kanan hingga data telah ditampilkan. Dan kolom panjang telah dibagi menjadi beberapa kolom agar muat pada satu halaman di lembar kerja baru. Lihat tangkapan layar:

doc-cetak-panjang-kolom1


panah gelembung kanan biru Cetak kolom panjang pada satu halaman dengan kode VBA

Kode VBA berikut juga bisa membantu Anda membagi daftar panjang data menjadi beberapa kolom, sehingga Anda bisa mencetak data dan menghemat kertas.

1. Tahan ALT + F11 kunci, dan itu membuka Microsoft Visual Basic untuk Aplikasi jendela.

2. Klik Menyisipkan > Modul, dan tempel kode berikut di Module Window.

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. Lalu tekan F5 kunci untuk menjalankan kode ini, dan pilih data daftar yang ingin Anda bagi di kotak dialog yang muncul, lihat tangkapan layar:

doc-cetak-panjang-kolom2

4. Klik OK, dan masukkan jumlah kolom yang ingin Anda bagi. Lihat tangkapan layar:

doc-cetak-panjang-kolom3

5. Dan klik OK, kolom panjang telah dibagi menjadi lima kolom di lembar kerja baru. Lihat tangkapan layar:

doc-cetak-panjang-kolom4 -2 doc-cetak-panjang-kolom5

panah gelembung kanan biru Cetak kolom panjang di satu halaman dengan Kutools for Excel

Baik rumus panjang dan kode VBA mungkin sulit untuk Anda, di sini saya dapat memperkenalkan Anda metode yang mudah dan nyaman untuk menyelesaikan masalah ini. Kutools untuk Excel'S Cetak Beberapa Kolom fungsi dapat membantu Anda dengan cepat membagi kolom panjang menjadi beberapa kolom sehingga Anda dapat mencetaknya secara wajar.

Kutools untuk Excel mencakup lebih dari 300 alat Excel yang praktis. Gratis untuk mencoba tanpa batasan dalam 30 hari. Dapatkan Sekarang.

Ketika Anda telah menginstal Kutools for Excel, Anda dapat melakukan langkah-langkah berikut:

1. Klik Enterprise > Cetak Beberapa Kolom, lihat tangkapan layar:

doc-cetak-panjang-kolom6

2. di Cetak Beberapa Kolom kotak dialog:

  • Klik yang pertama tombol-dok tombol untuk memilih judul rentang, lalu klik yang kedua tombol-doktombol untuk memilih kolom yang ingin Anda bagi.
  • Kemudian tentukan jumlah baris yang ingin Anda masukkan per halaman Baris per halaman cetak, dan masukkan jumlah kolom yang Anda inginkan dalam satu halaman di bawah Jumlah segmen. Lihat tangkapan layar:

doc-cetak-panjang-kolom7

3. Lalu klik OK, data daftar panjang telah dibagi menjadi lima kolom dalam satu halaman. Lihat tangkapan layar:

doc-cetak-panjang-kolom8 -2 doc-cetak-panjang-kolom9

Catatan:

1. Judul akan ditambahkan sebelum setiap kolom.

2. Jika Anda memeriksa Buat link dengan lembar aktif Opsi, data lembar kerja baru dapat ditautkan ke data sumber.

Jika Anda ingin tahu lebih banyak tentang fitur ini, silakan klik Cetak Beberapa Kolom.

Alat Produktivitas Kantor Terbaik

馃 Kutools AI Ajudan: Merevolusi analisis data berdasarkan: Eksekusi Cerdas   |  Hasilkan Kode  |  Buat Rumus Khusus  |  Analisis Data dan Hasilkan Grafik  |  Aktifkan Fungsi Kutools...
Fitur Populer: Temukan, Sorot, atau Identifikasi Duplikat   |  Hapus Baris Kosong   |  Gabungkan Kolom atau Sel tanpa Kehilangan Data   |   Putaran tanpa Formula ...
Pencarian Super: VLookup Beberapa Kriteria    VLookup Nilai Berganda  |   VLookup di Beberapa Lembar   |   Pencarian Fuzzy ....
Daftar Drop-down Lanjutan: Buat Daftar Drop Down dengan Cepat   |  Daftar Drop Down yang Bergantung   |  Multi-pilih Drop Down List ....
Manajer Kolom: Tambahkan Jumlah Kolom Tertentu  |  Pindahkan Kolom  |  Alihkan Status Visibilitas Kolom Tersembunyi  |  Bandingkan Rentang & Kolom ...
Fitur Unggulan: Fokus Kisi   |  Tampilan Desain   |   Bar Formula Besar    Manajer Buku Kerja & Lembar   |  Perpustakaan Sumberdaya (Teks otomatis)   |  Pemetik tanggal   |  Gabungkan Lembar Kerja   |  Enkripsi/Dekripsi Sel    Kirim Email berdasarkan Daftar   |  Filter Super   |   Filter Khusus (filter tebal/miring/coret...) ...
15 Perangkat Teratas12 Teks Tools (Tambahkan Teks, Hapus Karakter, ...)   |   50 + Grafik jenis (Gantt Chart, ...)   |   40+ Praktis Rumus (Hitung usia berdasarkan ulang tahun, ...)   |   19 Insersi Tools (Masukkan Kode QR, Sisipkan Gambar dari Jalur, ...)   |   12 Konversi Tools (Angka ke Kata, Konversi Mata Uang, ...)   |   7 Gabungkan & Pisahkan Tools (Lanjutan Gabungkan Baris, Pisahkan Sel, ...)   |   ... dan banyak lagi

Tingkatkan Keterampilan Excel Anda dengan Kutools for Excel, dan Rasakan Efisiensi yang Belum Pernah Ada Sebelumnya. Kutools for Excel Menawarkan Lebih dari 300 Fitur Lanjutan untuk Meningkatkan Produktivitas dan Menghemat Waktu.  Klik Di Sini untuk Mendapatkan Fitur yang Paling Anda Butuhkan...

Deskripsi Produk


Tab Office Membawa antarmuka Tab ke Office, dan Membuat Pekerjaan Anda Jauh Lebih Mudah

  • Aktifkan pengeditan dan pembacaan tab di Word, Excel, PowerPoint, Publisher, Access, Visio, dan Project.
  • Buka dan buat banyak dokumen di tab baru di jendela yang sama, bukan di jendela baru.
  • Meningkatkan produktivitas Anda sebesar 50%, dan mengurangi ratusan klik mouse untuk Anda setiap hari!
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