Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print block of range (2000 sr -1)

    I have this sheet with 5 block of range.
    How to make a macro and assing to the button in this mode:

    Set range from A to P (last cell in this case cont last cell from A) and print a copy
    Set range from R to AG (last cell in this case cont last cell from R) and print a copy
    ecc...


    Peraphs is a init:

    Option Explicit
    Sub ShowUsedRange()

    Dim ELENCO As Worksheet
    Dim RIGA_MAX As Integer
    Dim COLONNA_MAX As Integer
    Dim I As Integer
    Set ELENCO = Sheets("STAT_NEW")
    RIGA_MAX = ELENCO.Cells(65536, 1).End(xlUp).Row
    COLONNA_MAX = 16
    With ELENCO
    For I = 1 To 5
    ActiveSheet.PageSetup.PrintArea = "$A$1:" & Cells(RIGA_MAX, COLONNA_MAX).Address
    'HERE THE COMMAND TO PRINT OUT AREA
    COLONNA_MAX = COLONNA_MAX + 16
    Next I
    End With
    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Print block of range (2000 sr -1)

    First, specify Portrait instead of Landscape in File | Page Setup...

    Select columns A to P.
    Then hold down Ctrl and select colums R to AG.
    Still holding down Ctrl, select colums AI to AX.
    Still holding down Ctrl, select colums AZ to BO.
    Still holding down Ctrl, select colums BQ to CF.
    Then select File | Print Area | Set Print Area (Area di stampa | Imposta area di stampa)

    Each block will now be printed on a separate page. No code needed.

Posting Permissions

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