ไปยังเนื้อหาหลัก

วิธีพิมพ์คอลัมน์ยาวในหน้าเดียวใน Excel

สมมติว่าคุณมีรายการข้อมูลยาว ๆ ในคอลัมน์อาจจะ 200 แถวและตอนนี้คุณต้องพิมพ์ แต่เมื่อคุณพิมพ์จะใช้กระดาษประมาณ 5 หน้าโดยมีเพียงคอลัมน์เดียวที่ด้านซ้ายและมีช่องว่างสีขาว ด้านขวา ใน Word คุณสามารถจัดคอลัมน์ได้ แต่ Excel ไม่มีฟังก์ชันนี้ คุณจะพิมพ์ข้อมูลรายการยาวในหน้าเดียวเพื่อประหยัดกระดาษได้อย่างไร?

พิมพ์คอลัมน์ยาวในหน้าเดียวด้วยสูตร

พิมพ์คอลัมน์ยาวในหน้าเดียวด้วยรหัส VBA

พิมพ์คอลัมน์แบบยาวในหน้าเดียวด้วย Kutools for Excel


ลูกศรสีฟ้าฟองขวา พิมพ์คอลัมน์ยาวในหน้าเดียวด้วยสูตร

ที่นี่ฉันสามารถแนะนำสูตรยาว ๆ เพื่อแก้ปัญหานี้ได้โปรดทำตามนี้:

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 จากนั้นลากที่จับเติมไปทางขวาจนกว่าข้อมูลจะปรากฏ และคอลัมน์ยาวได้ถูกแบ่งออกเป็นหลายคอลัมน์เพื่อให้พอดีกับหนึ่งหน้าในแผ่นงานใหม่ ดูภาพหน้าจอ:

เอกสารพิมพ์ยาวคอลัมน์ 1


ลูกศรสีฟ้าฟองขวา พิมพ์คอลัมน์ยาวในหน้าเดียวด้วยรหัส VBA

รหัส VBA ต่อไปนี้ยังช่วยคุณแบ่งรายการข้อมูลยาว ๆ ออกเป็นหลายคอลัมน์เพื่อให้คุณสามารถพิมพ์ข้อมูลและประหยัดกระดาษได้

1. กด ALT + F11 และจะเปิดไฟล์ Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

2. คลิก สิ่งที่ใส่เข้าไป > โมดูลและวางรหัสต่อไปนี้ในหน้าต่างโมดูล

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 เพื่อเรียกใช้รหัสนี้และเลือกข้อมูลรายการที่คุณต้องการแบ่งในกล่องโต้ตอบที่โผล่ขึ้นมาดูภาพหน้าจอ:

เอกสารพิมพ์ยาวคอลัมน์ 2

4. คลิก OKและป้อนจำนวนคอลัมน์ที่คุณต้องการแบ่ง ดูภาพหน้าจอ:

เอกสารพิมพ์ยาวคอลัมน์ 3

5. และคลิก OKคอลัมน์แบบยาวถูกแบ่งออกเป็นห้าคอลัมน์ในแผ่นงานใหม่ ดูภาพหน้าจอ:

เอกสารพิมพ์ยาวคอลัมน์ 4 -2 เอกสารพิมพ์ยาวคอลัมน์ 5

ลูกศรสีฟ้าฟองขวา พิมพ์คอลัมน์แบบยาวในหน้าเดียวด้วย Kutools for Excel

ทั้งสูตรยาวและรหัส VBA อาจเป็นเรื่องยากสำหรับคุณที่นี่ฉันสามารถแนะนำวิธีที่ง่ายและสะดวกในการแก้ปัญหานี้ Kutools สำหรับ Excel's พิมพ์หลายคอลัมน์ ฟังก์ชันสามารถช่วยคุณแบ่งคอลัมน์ยาวออกเป็นหลายคอลัมน์ได้อย่างรวดเร็วเพื่อให้คุณสามารถพิมพ์ได้อย่างสมเหตุสมผล

Kutools สำหรับ Excel มีเครื่องมือ Excel ที่มีประโยชน์มากกว่า 300 รายการ ทดลองใช้ฟรีโดยไม่มีข้อ จำกัด ใน 30 วัน Get it Now.

เมื่อคุณติดตั้ง Kutools for Excel แล้วคุณสามารถทำตามขั้นตอนต่อไปนี้:

1. คลิก Enterprise > พิมพ์หลายคอลัมน์ดูภาพหน้าจอ:

เอกสารพิมพ์ยาวคอลัมน์ 6

2. ใน พิมพ์หลายคอลัมน์ กล่องโต้ตอบ:

  • คลิกตัวแรก ปุ่ม doc เพื่อเลือกชื่อของช่วงจากนั้นคลิกปุ่มที่สอง ปุ่ม docเพื่อเลือกคอลัมน์ที่คุณต้องการแบ่ง
  • จากนั้นระบุจำนวนแถวที่คุณต้องการใส่ต่อหน้า แถวต่อหน้าที่พิมพ์และป้อนจำนวนคอลัมน์ที่คุณต้องการในหน้าเดียว จำนวนกลุ่ม. ดูภาพหน้าจอ:

เอกสารพิมพ์ยาวคอลัมน์ 7

3. จากนั้นคลิก OKข้อมูลรายการยาวถูกแบ่งออกเป็นห้าคอลัมน์ในหนึ่งหน้า ดูภาพหน้าจอ:

เอกสารพิมพ์ยาวคอลัมน์ 8 -2 เอกสารพิมพ์ยาวคอลัมน์ 9

หมายเหตุ:

1. ชื่อเรื่องจะถูกเพิ่มก่อนทุกคอลัมน์

2. หากคุณตรวจสอบ สร้างลิงค์ด้วยแผ่นงานที่ใช้งานอยู่ ตัวเลือกข้อมูลแผ่นงานใหม่สามารถเชื่อมโยงกับแหล่งข้อมูล

หากคุณต้องการทราบข้อมูลเพิ่มเติมเกี่ยวกับคุณลักษณะนี้โปรดคลิก พิมพ์หลายคอลัมน์.

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, 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