Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2446
  • Last Modified:

Print wrapped columns in Excel 2010

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
AndyPandy
Asked:
AndyPandy
  • 3
  • 3
1 Solution
 
jimyXCommented:
You can format the cells:
Select your cells -> right click -> format cells -> from the Alignment tab check the Wrap text then OK.
0
 
jimyXCommented:
Another way is from Home -> Alignment -> Wrap Text.
0
 
jimyXCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
dlmilleCommented:
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
 
dlmilleCommented:

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
 
dlmilleCommented:
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
1
 
AndyPandyAuthor Commented:
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now