Solved

Print wrapped columns in Excel 2010

Posted on 2011-03-05
7
1,018 Views
Last Modified: 2012-05-11
Hi Experts,

How can I get "Excel 2010" to print wrapped columns?

I have two narrow columns within a worksheet.
I would like to wrap(snake)  the columns so that a printed page is filled before going to print the next sheet.
So rows 1 through 60 are in the first two columns page 1,  the next 60 rows are in the 3rd & 4th columns (again page 1), etc.

Thanks
0
Comment
Question by:AndyPandy
  • 3
  • 3
7 Comments
 
LVL 24

Expert Comment

by:jimyX
Comment Utility
You can format the cells:
Select your cells -> right click -> format cells -> from the Alignment tab check the Wrap text then OK.
0
 
LVL 24

Expert Comment

by:jimyX
Comment Utility
Another way is from Home -> Alignment -> Wrap Text.
0
 
LVL 24

Expert Comment

by:jimyX
Comment Utility
And to adjust the columns visibility you may adjust the column's width and the row's height until you get your desired form to print.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 41

Expert Comment

by:dlmille
Comment Utility
I did a solution on somthing like this (there were two solutions, and mine wasn't picked.  feel free to use the first, but I created a macro that broke the three columns up into page sizes and formatted a page from those columns that could be printed).

http://www.experts-exchange.com/Q_26732871.html

Let me know if this helps and if you want to further persue, I"m happy to help!

Cheers,

Dave
0
 
LVL 41

Expert Comment

by:dlmille
Comment Utility

If you want to keep it all in Excel, the attached "wraps" to 60 rows, and operates on the first 3 columns.  See attached:

The "create word" document tip in the link I sent in the post (above) is a good one, but it is a bit "manual", though a macro COULD be written to handle.

See the second attachment, rewritten to handle the first three Columns in Excel and outputs to the printed page.

If you'd like either modified to suit, or you can take it from here, please let me know!

Dave

its-quick-by-hand-r2.xlsx
0
 
LVL 41

Accepted Solution

by:
dlmille earned 500 total points
Comment Utility
The following code assumes a long list of two columns.  It creates an "output sheet" dynamically after prompting you for maximum rows per page of print, and whether you have headers or not.

The App then generates a set of columns, 60 rows by 2 columns, then shifts to the right and regenerates again and again until the end of the data.

Hope this helps.  The 60 rows and 2 columns are defaults, and I've added code to prompt you for those, in case your needs change.

Dave
Sub GenerateOutputToPrint()
Dim outSheet As Worksheet
Dim inSheet As Worksheet
Dim outCursor As Range
Dim lRow As Long, lastRow As Long
Dim maxRows As Long, repeatAtTop As Boolean
Dim numColumns As Long

Application.ScreenUpdating = False

    maxRows = InputBox("Enter Max Rows Per Page of Output", "E.g., 60", 60)
    numColumns = InputBox("Enter # Columns in your dataset for printing", "E.g., 2", 2)
    repeatAtTop = MsgBox("Do your columns have headers?", vbYesNo)
    
    
    'assumes two columns of data, per original question asked (dlmille E-E on 3/6/2011)
    
        lastRow = Cells.Find(What:="*", After:=[A1], _
                SearchOrder:=xlByRows, _
                SearchDirection:=xlPrevious).Row

        Set inSheet = ActiveSheet
        Set outSheet = Worksheets.Add ' this is where the output will go
        Set outCursor = outSheet.Range("A1")
        
        
        For lRow = 1 To lastRow
        
            outCursor.Resize(1, numColumns).Value = Range(inSheet.Cells(lRow, 1), inSheet.Cells(lRow, numColumns)).Value 'copy the first two columns to output page

            If (lRow - 1) Mod maxRows = 0 And lRow > 1 Then 'every 60 rows, generate new set of columns - so shift outCursor to the right, and back up to the top!
                Set outCursor = outCursor.Offset(0, numColumns).End(xlUp)
                
                If repeatAtTop Then 'get headers and repeat them
                    outCursor.Resize(1, numColumns).Value = Range(inSheet.Cells(1, 1), inSheet.Cells(1, numColumns)).Value 'copy the first two column headers to new columns
                    Set outCursor = outCursor.Offset(1, 0) 'ready for next row of input
                End If
            Else
                Set outCursor = outCursor.Offset(1, 0) 'ready for next row of input
            End If
        Next lRow
                    
Application.ScreenUpdating = True
End Sub

Open in new window

WrapColumnsForPrint-r1.xlsm
0
 

Author Comment

by:AndyPandy
Comment Utility
Thanks dmille, your BA worked well!
I am surprised there is not a native function within excel to do this.
Excel-columns.JPG
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now