Skip i'r prif gynnwys

Sut i argraffu colofn hir ar un dudalen yn Excel?

Gan dybio bod gennych chi restr hir o ddata mewn colofn, efallai 200 rhes, ac nawr mae angen i chi eu hargraffu, ond pan fyddwch chi'n argraffu, mae'n defnyddio tua 5 papur, gyda dim ond un golofn ar yr ochr chwith, a llawer o le gwyn ar yr ochr dde. Mewn gair, gallwch golofn, ond nid oes gan Excel y swyddogaeth hon. Sut ydych chi'n argraffu'r data rhestr hir ar un dudalen i achub y papur?

Argraffu colofn hir ar un dudalen gyda fformiwla

Argraffu colofn hir ar un dudalen gyda chod VBA

Argraffwch golofn hir ar un dudalen gyda Kutools ar gyfer Excel


swigen dde glas saeth Argraffu colofn hir ar un dudalen gyda fformiwla

Yma, gallaf gyflwyno fformiwla hir i ddatrys y broblem hon, gwnewch fel hyn:

1. Mewn taflen waith newydd o'ch llyfr gwaith gweithredol, nodwch y fformiwla =IF(OFFSET(Sheet1!$A$1,(COLUMN()-1)*45+ROW()-1,0)="","",OFFSET(Sheet1!$A$1,(COLUMN()-1)*45+ROW()-1,0)) i mewn i'r gell A1.

Nodiadau: Sheet1 yw'r daflen waith sydd â'r rhestr hir rydych chi am ei cholofnio.

45 yw'r rhif rhes rydych chi am restru'r data mewn colofn.

Maent i gyd yn newidynnau, a gallwch eu newid fel eich angen.

2. Yna dewiswch gell A1, a llusgwch y handlen llenwi i lawr i res 45, ac yna ewch ymlaen i lusgo'r handlen llenwi ar draws i'r dde nes bod y data wedi'i arddangos. Ac mae'r golofn hir wedi'i rhannu'n sawl colofn i ffitio ar un dudalen mewn taflen waith newydd. Gweler y screenshot:

doc-print-hir-colofn1


swigen dde glas saeth Argraffu colofn hir ar un dudalen gyda chod VBA

Gall y cod VBA canlynol hefyd eich helpu i rannu rhestr hir o ddata yn sawl colofn, fel y gallwch argraffu'r data ac arbed papur.

1. Daliwch i lawr y ALT + F11 allweddi, ac mae'n agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Cliciwch Mewnosod > Modiwlau, a gludwch y cod canlynol yn y Ffenestr Modiwl.

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. Yna pwyswch y F5 allwedd i redeg y cod hwn, a dewis y data rhestr rydych chi am ei rannu yn y blwch deialog popped up, gweler y screenshot:

doc-print-hir-colofn2

4. Cliciwch OK, a nodwch nifer y colofnau rydych chi am eu rhannu. Gweler y screenshot:

doc-print-hir-colofn3

5. a chliciwch OK, mae'r golofn hir wedi'i rhannu'n bum colofn mewn taflen waith newydd. Gweler sgrinluniau:

doc-print-hir-colofn4 -2 doc-print-hir-colofn5

swigen dde glas saeth Argraffwch golofn hir ar un dudalen gyda Kutools ar gyfer Excel

Efallai y bydd y fformiwla hir a'r cod VBA yn anodd i chi, yma gallaf gyflwyno dull hawdd a chyfleus i chi ddatrys y broblem hon. Kutools ar gyfer Excel'S Argraffu Colofnau Lluosog gall swyddogaeth eich helpu i rannu'r golofn hir yn gyflym i sawl colofn fel y gallwch eu hargraffu'n rhesymol.

Kutools ar gyfer Excel yn cynnwys mwy na 300 o offer Excel defnyddiol. Am ddim i geisio heb unrhyw gyfyngiad mewn 30 diwrnod. Get it Now.

Pan fyddwch wedi gosod Kutools ar gyfer Excel, gallwch chi wneud y camau canlynol:

1. Cliciwch Menter > Argraffu Colofnau Lluosog, gweler y screenshot:

doc-print-hir-colofn6

2. Yn y Argraffu Colofnau Lluosog blwch deialog:

  • Cliciwch y cyntaf botwm doc botwm i ddewis teitl yr ystod, ac yna cliciwch yr ail botwm docbotwm i ddewis y golofn rydych chi am ei rhannu.
  • Yna nodwch nifer y rhesi rydych chi am eu rhoi ar bob tudalen Rhesi ar bob tudalen argraffedig, a nodwch nifer y colofnau rydych chi eu heisiau mewn un dudalen o dan Nifer y segmentau. Gweler y screenshot:

doc-print-hir-colofn7

3. Yna cliciwch OK, mae'r data rhestr hir wedi'i rannu'n bum colofn mewn tudalen. Gweler sgrinluniau:

doc-print-hir-colofn8 -2 doc-print-hir-colofn9

Nodiadau:

1. Ychwanegir y teitl cyn pob colofn.

2. Os gwiriwch Creu dolen gyda'r ddalen weithredol opsiwn, gellir cysylltu'r data taflen waith newydd â'r data ffynhonnell.

Os ydych chi eisiau gwybod mwy am y nodwedd hon, cliciwch Argraffu Colofnau Lluosog.

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
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