richiesta aiuto



  • richiesta aiuto
    di kcpastore data: 09/07/2013 12:13:21

    Buongiorno a tutti, premetto che non sono molto pratico di linguaggio vba, però mi diletto.
    Ho creato, per lavoro, una routine che è diventata troppo grande per essere eseguita e vorrei un aiuto da parte Vostra.
    Mi spiego meglio, come posso o meglio se è possibile dividere questa routine in più parti o se avete dei consigli di come strutturarla meglio sono ben accetti.
    Nel ringraziarvi porgo distinti saluti.

    Ps inserisco il codice da me creato.

    Grazie
     
    Private Sub CommandButton7_Click()
    'Sub SCHEDA DA STAMPARE()
    Sheets("SCHEDE").Activate
    Dim messaggio, titolo
    Dim NUMERO As Integer
    titolo = "STAMPA SCHEDA"
    messaggio = "INSERISCI NUMERO DI SCHEDA CHE SI INTENDE STAMPARE"
    valore = InputBox(messaggio, titolo)
    Range("ax2").Select
    ActiveCell = valore
    NUMERO = valore
    Select Case valore
    Case NUMERO = 0
    Exit Sub
    Case NUMERO = 1
    Range("A5:AI53").Select
        ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$53"
    Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A5:AI53").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    
    'ActiveWindow.SelectedSheets.PrintPreview
    Selection.AutoFilter Field:=1
    Range("A5:AI5982").Select
        ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '=================================================================
    
    Case NUMERO = 2
    Range("A54:AI102").Select
    ActiveSheet.PageSetup.PrintArea = "$A$54:$AI$102"
    'Selection.AutoFilter Field:=1, Criteria1:=NUMERO
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A54:AI102").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
    'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 3
    Range("A103:AI151").Select
    ActiveSheet.PageSetup.PrintArea = "$A$103:$AI$151"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A103:AI151").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 4
    Range("A152:AI200").Select
        ActiveSheet.PageSetup.PrintArea = "$A$152:$AI$200"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A152:AI200").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 5
    Range("A201:AI249").Select
        ActiveSheet.PageSetup.PrintArea = "$A$201:$AI$249"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A201:AI249").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 6
    Range("A250:AI298").Select
        ActiveSheet.PageSetup.PrintArea = "$A$250:$AI$298"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A250:AI298").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 7
    Range("A299:AI347").Select
        ActiveSheet.PageSetup.PrintArea = "$A$299:$AI$347"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A299:AI347").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 8
    Range("A348:AI396").Select
        ActiveSheet.PageSetup.PrintArea = "$A$348:$AI$396"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A348:AI396").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    ''Selection.AutoFilter Field:=1
    ''Range("A5:AI5982").Select
        ''ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 9
    Range("A397:AI445").Select
        ActiveSheet.PageSetup.PrintArea = "$A$397:$AI$445"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A397:AI445").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 10
    Range("A446:AI494").Select
        ActiveSheet.PageSetup.PrintArea = "$A$446:$AI$494"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A446:AI494").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 11
    Range("A495:AI543").Select
        ActiveSheet.PageSetup.PrintArea = "$A$495:$AI$543"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A495:AI543").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 12
    Range("A544:AI592").Select
        ActiveSheet.PageSetup.PrintArea = "$A$544:$AI$592"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A544:AI592").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 13
    Range("A593:AI641").Select
        ActiveSheet.PageSetup.PrintArea = "$A$593:$AI$641"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A593:AI641").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 14
    Range("A642:AI690").Select
        ActiveSheet.PageSetup.PrintArea = "$A$642:$AI$690"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A642:AI690").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 15
    Range("A691:AI739").Select
        ActiveSheet.PageSetup.PrintArea = "$A$691:$AI$739"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A691:AI739").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 16
    Range("A740:AI788").Select
        ActiveSheet.PageSetup.PrintArea = "$A$740:$AI$788"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A740:AI788").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 17
    Range("A789:AI837").Select
        ActiveSheet.PageSetup.PrintArea = "$A$789:$AI$837"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A789:AI837").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 18
    Range("A838:AI886").Select
        ActiveSheet.PageSetup.PrintArea = "$A$838:$AI$886"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A838:AI886").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 19
    Range("A887:AI935").Select
        ActiveSheet.PageSetup.PrintArea = "$A$887:$AI$935"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A887:AI935").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 20
    Range("A936:AI984").Select
        ActiveSheet.PageSetup.PrintArea = "$A$936:$AI$984"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A936:AI984").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 21
    Range("A985:AI1033").Select
        ActiveSheet.PageSetup.PrintArea = "$A$985:$AI$1033"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A985:AI1033").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 22
    Range("A1034:AI1082").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1034:$AI$1082"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1034:AI1082").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 23
    Range("A1083:AI1131").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1083:$AI$1131"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1083:AI1131").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 24
    Range("A1132:AI1180").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1132:$AI$1180"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1132:AI1180").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 25
    Range("A1181:AI1229").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1181:$AI$1229"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1181:AI1229").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 26
    Range("A1230:AI1278").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1230:$AI$1278"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1230:AI1278").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 27
    Range("A1279:AI1327").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1279:$AI$1327"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1279:AI1327").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 28
    Range("A1328:AI1376").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1328:$AI$1376"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1328:AI1376").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 29
    Range("A1377:AI1425").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1377:$AI$1425"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1377:AI1425").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 30
    Range("A1426:AI1474").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1426:$AI$1474"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1426:AI1474").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 31
    Range("A1475:AI1523").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1475:$AI$1523"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1475:AI1523").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 32
    Range("A1524:AI1572").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1524:$AI$1572"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1524:AI1572").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 33
    Range("A1573:AI1621").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1573:$AI$1621"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1573:AI1621").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 34
    Range("A1622:AI1670").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1622:$AI$1670"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1622:AI1670").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 35
    Range("A1671:AI1719").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1671:$AI$1719"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1671:AI1719").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 36
    Range("A1720:AI1768").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1720:$AI$1768"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1720:AI1768").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 37
    Range("A1769:AI1817").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1769:$AI$1817"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1769:AI1817").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 38
    Range("A1818:AI1866").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1818:$AI$1866"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1818:AI1866").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 39
    Range("A1867:AI1915").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1867:$AI$1915"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1867:AI1915").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    Case NUMERO = 40
    Range("A1916:AI1964").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1916:$AI$1964"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1916:AI1964").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 41
    Range("A1965:AI2013").Select
        ActiveSheet.PageSetup.PrintArea = "$A$1965:$AI$2013"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A1965:AI2013").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 42
    Range("A2014:AI2062").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2014:$AI$2062"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2014:AI2062").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 43
    Range("A2063:AI2111").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2063:$AI$2111"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2063:AI2111").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 44
    Range("A2112:AI2160").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2112:$AI$2160"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2112:AI2160").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 45
    Range("A2161:AI2209").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2161:$AI$2209"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2161:AI2209").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 46
    Range("A2210:AI2258").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2210:$AI$2258"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2210:AI2258").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 47
    Range("A2259:AI2307").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2259:$AI$2307"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2259:AI2307").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 48
    Range("A2308:AI2356").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2308:$AI$2356"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2308:AI2356").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 49
    Range("A2357:AI2405").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2357:$AI$2405"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2357:AI2405").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 50
    Range("A2406:AI2454").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2406:$AI$2454"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2406:AI2454").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    
    
    Case NUMERO = 51
    Range("A2455:AI2503").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2455:$AI$2503"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    Unload Me
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2455:AI2503").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 52
    Range("A2504:AI2552").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2504:$AI$2552"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    'UNLOAD ME
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2504:AI2552").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 53
    Range("A2553:AI2601").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2553:$AI$2601"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    'UNLOAD ME
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2553:AI2601").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 54
    Range("A2602:AI2650").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2602:$AI$2650"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    'UNLOAD ME
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2602:AI2650").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 55
    Range("A2651:AI2699").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2651:$AI$2699"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    'UNLOAD ME
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2651:AI2699").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 56
    Range("A2700:AI2748").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2700:$AI$2748"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    'UNLOAD ME
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2700:AI2748").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 57
    Range("A2749:AI2797").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2749:$AI$2797"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    'UNLOAD ME
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2749:AI2797").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 58
    Range("A2798:AI2846").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2798:$AI$2846"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    'UNLOAD ME
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2798:AI2846").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 59
    Range("A2847:AI2895").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2847:$AI$2895"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    'UNLOAD ME
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2847:AI2895").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
            Beep
            'MsgBox "STAMPA LETTERA TRASMISSIONE EFFETTUATA CON SUCCESSO"
    End If
    'ActiveWindow.SelectedSheets.PrintPreview
    'Selection.AutoFilter Field:=1
    'Range("A5:AI5982").Select
        'ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    '==================================================================
    Case NUMERO = 60
    Range("A2896:AI2944").Select
        ActiveSheet.PageSetup.PrintArea = "$A$2896:$AI$2944"
    'Selection.AutoFilter Field:=1, Criteria1:="1"
    'UNLOAD ME
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate _
            :=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
    
    Range("A2896:AI2944").Select
        Selection.Copy
        Sheets("APPOGGIO").Select
        Range("A5:AI5").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, ...



  • di HarryBosch data: 09/07/2013 13:32:39

    Ciao kcpastore
    Siccome le istruzione sono tutte uguali e cambia soltanto il range di destinazione, nei select case puoi inserire soltanto il relativo intervallo e poi applicarlo alle istruzioni che verranno scritte una sola volta.

    Nel tuo caso gli intervalli seguono uno "spazio" regolare, e pertanto si può anche calcolare la prima e ultima riga di ogni intervallo partendo dal valore iniziale inserito.
    Una cosa del tipo sotto...

    Non ho verificato le altre istruzioni.
     
    Private Sub CommandButton7_Click()
    
    Dim valore As String
    Dim r1 As Integer, r2 As Integer
    Dim RNG As Range
    
    Sheets("SCHEDE").Activate
    valore = InputBox("INSERISCI NUMERO DI SCHEDA CHE SI INTENDE STAMPARE", "STAMPA SCHEDA")
    
    Select Case valore
    Case 0
        Exit Sub
    Case Else
        r1 = (valore * 48) - 44 + valore
        r2 = r1 + 48
        Set RNG = Range("A" & r1 & ":AI" & r2)
    End Select
        
    ActiveSheet.PageSetup.PrintArea = RNG
    RNG.AutoFilter Field:=1, Criteria1:="1"
    
    Unload Me
    
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=1, Copies:=1, Collate:=True, IgnorePrintAreas:=False
    
    If MsgBox("Vuoi stampare un'altra copia della lettera scheda con attestazione della minuta???", vbYesNo) = vbYes Then
       RNG.Copy
       Sheets("APPOGGIO").[A5:AI5].Select
       Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
    ActiveWindow.SelectedSheets.PrintOut From:=1, TO:=2, Copies:=1, Collate:=True, IgnorePrintAreas:=False
            Beep
    End If
    
    ActiveWindow.SelectedSheets.PrintPreview
    Selection.AutoFilter Field:=1
    Range("A5:AI5982").Select
    ActiveSheet.PageSetup.PrintArea = "$A$5:$AI$5982"
    
    End Sub
    



  • di Vecchio Frac data: 09/07/2013 13:33:20

    Benvenuto nel forum.
    Non entro nel merito (per il momento) ma ti invito, per il futuro, ad indicare un titolo meglio descrittivo per le problematiche che esponi ("richiesta aiuto" non va bene).

    Sulla questione specifica, se ci illustrassi cosa fa il codice che hai postato sarebbe meglio, per non farci passare molto tempo a cercare di decifrarlo :)





  • di kcpastore (utente non iscritto) data: 09/07/2013 14:30:14

    Scusandomi vi soiego cosa fa il codice
    Io ho creato delle schede il codice in pratica richiama la scheda mi serve e la stampa



  • di Vecchio Frac data: 09/07/2013 21:46:13

    Bravo Harry per l'analisi e bravo il nostro patron Mauro l'Amministratore per aver aggiustato questo thread lunghissimo ^_^





  • di kcpastore (utente non iscritto) data: 10/07/2013 08:02:27

    Grazie a Herry. Ho usato la 1 soluzione che hai dato, considerato che le istruzione erano tutti uguali ho inserito l'istruzione alla fine della routine.

    Grazie a tutti per la gentile collaborazione.

    Saluti