Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Print specific sheets seperately to printer and PDF

  1. #11
    New Member
    Join Date
    Oct 2019
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Print specific sheets seperately to printer and PDF

    It doesn't work...

    I can see the system loading as if it is working on something, however none of the files are being created in the same folder as of my current workbook, unlike the previous version you suggested.

  2. #12
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,922
    Post Thanks / Like
    Mentioned
    84 Post(s)
    Tagged
    15 Thread(s)

    Default Re: Print specific sheets seperately to printer and PDF

    The editor removed the Backslash.
    Try this please

    Code:
    Sub Print_sheets()
      Dim sh As Worksheet, i As Long, shs As Variant, w2 As Workbook, sh2 As Worksheet
      Application.ScreenUpdating = False
      Application.DisplayAlerts = False
      shs = Array("PrixMax", "6po", "Quote")
      For Each sh In Sheets
        For i = 0 To UBound(shs)
          If LCase(sh.Name) Like "*" & LCase(shs(i)) & "*" Then
            Set w2 = Workbooks.Add
            Set sh2 = w2.Sheets(1)
            sh.Cells.Copy
            sh2.Range("A1").PasteSpecial xlPasteValues
            sh2.Range("A1").PasteSpecial xlPasteFormats
            w2.SaveAs Filename:=ThisWorkbook.Path & "\" & sh.Name & ".xlsx"
            w2.Close False
            Exit For
          End If
        Next
      Next
    End Sub
    Regards Dante Amor

  3. #13
    New Member
    Join Date
    Oct 2019
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Print specific sheets seperately to printer and PDF

    Hi Dante

    It did fix the cells with formula but created other problems.
    Somehow it changed my sheet format.

    I found an alternative solution for me to deal with the formula issue. I changed it before the saving even occurs. It's not ideal for me but the final result is the same.

    Thanks a lot for your time

  4. #14
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,922
    Post Thanks / Like
    Mentioned
    84 Post(s)
    Tagged
    15 Thread(s)

    Default Re: Print specific sheets seperately to printer and PDF

    I'm glad to help you. Thanks for the feedback.
    Regards Dante Amor

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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