+ Reply to Thread
Results 1 to 3 of 3

Print selection and fit all colums to one page

  1. #1
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    162

    Question Print selection and fit all colums to one page

    Good day,

    I have bellow code for printing two copies of selected range

    Sub Print()

    Sheets("Table").Select
    LR = Range("H" & Rows.Count).End(xlUp).Row

    For icell = LR To 1 Step -1
    If Range("H" & icell).Value > 0 Then
    Range("A6:W" & icell).Select

    Exit For
    End If
    Next icell


    Selection.PrintOut Copies:=2, Collate:=True
    but I need to fit all columns to one page (A4 ladscape orientation).

    How to do that?

  2. #2
    Registered User
    Join Date
    04-30-2013
    Location
    Brussels
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Print selection and fit all colums to one page

    Hello forfiett,

    Just add this before your Selection.Printout:

    Please Login or Register  to view this content.
    Have fun!
    ExcelTab.com

  3. #3
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    162

    Re: Print selection and fit all colums to one page

    my code that is woking:

    Sub ALL()

    Sheets("Table").Select
    LR = Range("Q" & Rows.Count).End(xlUp).Row

    For icell = LR To 1 Step -1
    If Range("Q" & icell).Value > 0 Then
    Range("A2:W" & icell).Select

    Exit For
    End If
    Next icell

    '

    ActiveSheet.PageSetup.PrintArea = "A2:W" & icell
    With ActiveSheet.PageSetup
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = False
    End With


    'ActiveWindow.SelectedSheets.PrintPreview ' Print on screen

    ActiveWindow.SelectedSheets.PrintOut Copies:=2 ' Print on paper




    End Sub
    Many thanks for help

+ 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