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

    Select printer from userform (2000)

    The code hre print a sheet before to seelct range and area.
    But before to print is possible to show a userform with the list of printer and select one and continue the code with selected printer from the list?
    code:
    Sub PRINT_RANGE_1()
    'ANDREA CHELLINI

    Dim ELENCO As Worksheet
    Dim RIGA_MAX As Integer
    Dim RIGA_PRINT As Integer
    Dim COLONNA_MAX As Integer, PRIMA_COLONNA As Integer, I As Integer

    Application.ScreenUpdating = False

    'Sheets("STAT_NEW").Select

    ActiveSheet.PageSetup.PrintArea = ""

    Set ELENCO = Sheets("STAT_NEW")
    RIGA_MAX = ELENCO.Cells(65536, 1).End(xlUp).Row
    PRIMA_COLONNA = 1
    COLONNA_MAX = 31
    RIGA_PRINT = 31

    With ELENCO

    For I = 1 To 5
    ELENCO.PageSetup.PrintArea = Cells(1, PRIMA_COLONNA).Resize(RIGA_MAX, COLONNA_MAX).Address(True, True, xlA1)
    With ELENCO.PageSetup
    .PrintTitleRows = "$1:$4"
    .PrintTitleColumns = ""
    .RightFooter = "&""Arial,Grassetto""&8PAGINA &P DI &N"
    End With

    If ELENCO.Cells(3, RIGA_PRINT) > 0 Then
    ELENCO.PrintOut Copies:=1, Collate:=True
    End If
    RIGA_PRINT = RIGA_PRINT + COLONNA_MAX + 1
    PRIMA_COLONNA = PRIMA_COLONNA + COLONNA_MAX + 1
    Next I

    End With

    ELENCO.PageSetup.PrintArea = ""

    Me.Repaint

    Sheets("LUSTSTP").Select

    Me.TextBox1.SetFocus

    MsgBox ("STAMPA STATISTICA COMPLETATA"), vbInformation, "STAMPA STATISTICA"

    Application.ScreenUpdating = True

    End Sub

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

    Re: Select printer from userform (2000)

    Instead of using

    ELENCO.PrintOut Copies:=1, Collate:=True

    you can display the print dialog, so that the user can select a printer and set other options:

    Application.Dialogs(xlDialogPrint).Show

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select printer from userform (2000)

    TKS!!!!!!!!!!!!!

Posting Permissions

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