Excel listbox sheet select to pdf

  • Hey,

    I am new to visual basic. for the company where I work I am working on an excel document for safty documents. the excel becomes a library of all the documents we have within the company. Each document gets its own sheet. different sheets are used per project. to realize this I made a list box where you can select the sheets. I succeed in printing the selected sheets on a printer, but I do not succeed in bundling them into 1 PDF. I would also like it to show the save as menu so you can assign a location and maby directly to te place where te excel is placed.

    in the attachment what I have made so far.

    for printing i used the code:



    Code
    1. Private Sub Afdrukken_standaardprinter_Click()
    2. If MsgBox("Afdrukken op standaard printer.", vbOKCancel, "Printen") = vbOK Then
    3. For x = 0 To LstPrint.ListCount - 1
    4. If LstPrint.Selected(x) = True Then Worksheets(LstPrint.List(x)).PrintOut Copies:=1, Collate:=True
    5. Next
    6. End If
    7. End Sub

    Thanks for the help

    (sorry for the bad english)

    Matthijs Head

    Files

    • Test TRA.xlsm

      (729.56 kB, downloaded 12 times, last: )
  • Post by jolivanes ().

    This post was deleted by the author themselves ().
  • Post by salina123 ().

    This post was deleted by royUK ().