+ Reply to Thread
Results 1 to 5 of 5

Print Wrap/Formatting for Printing?

Hybrid View

  1. #1
    Registered User
    Join Date
    10-14-2008
    Location
    New York
    Posts
    15

    Print Wrap/Formatting for Printing?

    Hey all, thanks again in advance for the help.

    I was wondering if it was possible to do what I had in mind with out a macro or a very simple macro but in all honesty I would rather not use a macro and hope I just don't know something about Excel.

    I have a very wide document. Going many columns across. This is fine when using the document on the computer but when printed out it is very difficult to read or goes across multiple sheets. I was wondering if it is possible to have data wrap onto the first printed page as an optimal way for me to "fit to page". I know it isn't ideal but it would be much easier on everyone's eyes.

    For example:

    [A1][B1][C1][D1][E1][F1]
    [A2][B2][C2][D2][E2][F2]
    [A3][B3][C3][D3][E3][F3]

    With a page break between columns C and D would print like this:

    [A1][B1][C1] [D1][E1][F1]
    [A2][B2][C2] [D2][E2][F2]
    [A3][B3][C3] [D3][E3][F3]

    What I want is this:
    [A1][B1][C1]
    [D1][E1][F1]
    [A2][B2][C2]
    [D2][E2][F2]
    [A3][B3][C3]
    [D3][E3][F3]

    on one or more pages, extra pages would be going vertically not horizontal.

    Thanks!
    Last edited by RaydenEG; 07-15-2009 at 05:36 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Print Wrap/Formatting for Printing?

    Hi Rayden,

    I think the only way you're going to accomplish that is via macro to re-organize your data, print it, then set it back the way it was. (Or create a copy of the worksheet, re-org that data, print it, delete the temp sheet - so you're not messing with your live data.)

  3. #3
    Registered User
    Join Date
    10-14-2008
    Location
    New York
    Posts
    15

    Re: Print Wrap/Formatting for Printing?

    That's a shame. It would be very convenient. I am reluctant to write a macro but unfortunately that might be the best solution.

    thanks.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Print Wrap/Formatting for Printing?

    The following macro, placed in your main data sheet, might suit your needs. You may need to adjust the Sheet names and columns to match your data layout, but it should give you a good start. If you have questions let us know (at which point we'll probably ask you to upload your workbook, or a copy of it minus any private data).
    Sub orgPrintData()
    Dim ws As Worksheet, myRng As Range, i As Long
    ' Turn off screen updating to reduce screen flicker and speed up macro
    Application.ScreenUpdating = False
    ' Turn off alerts for when the temp sheet is deleted
    Application.DisplayAlerts = False
    
    ' Set the original data range - change sheet/column references as needed
    Set myRng = Sheets("Sheet1").Columns("A:F")
    
    ' If sheet "Org Print Data" exists, delete it
    On Error Resume Next
    If Len(Sheets("Org Print Data")) > 0 Then Sheets("Org Print Data").Delete
    On Error GoTo 0
    
    ' Add new worksheet
    Set ws = Worksheets.Add
    With ws
        ' Name new sheet
        .Name = "Org Print Data"
        'Copy original data range to new sheet to re-organize
        myRng.Copy .Range("A1")
        ' Re-organize data, such that D1:F1 will end up below A1:C1
        ' and D2:F2 will be below the original A2:C2, etc.
        For i = 1 To .Range("D65536").End(xlUp).Row
            .Range(.Cells(i, 4), .Cells(i, 6)).Cut
            .Cells(i * 2, 1).Insert Shift:=xlDown
        Next i
        ' Add page break before column D
        .VPageBreaks.Add Before:=.Range("D1")
        ' Open PrintPreview window
        .PrintPreview
        ' Delete "Org Print Data" sheet
        .Delete
    End With
    'Turn alerts and screen updating back on
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    End Sub

  5. #5
    Registered User
    Join Date
    10-14-2008
    Location
    New York
    Posts
    15

    Re: Print Wrap/Formatting for Printing?

    Very helpful! I have been able to work with the macro and get it to work. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1