VBA Code to prompt a user to print out
Results 1 to 4 of 4

Thread: VBA Code to prompt a user to print out
Thanks Thanks: 0 Likes Likes: 0

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

    Default VBA Code to prompt a user to print out

    I have some existing code that automatically prints a copy of a worksheet in my book

    #code

    Sheets("NMR Form").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
    IgnorePrintAreas:=False

    #endcode

    Instead of automatically printing, I would like the user to have the option to print or not print the sheet. I read through some of the other threads and didn't find anything like this. Is it possible?
    Thank you

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    26,976
    Post Thanks / Like
    Mentioned
    459 Post(s)
    Tagged
    45 Thread(s)

    Default Re: VBA Code to prompt a user to print out

    Hi & welcome to MrExcel.
    How about
    Code:
    Sub dixielou()
       If MsgBox("do you want to print the sheet", vbYesNo) = vbYes Then
          Sheets("NMR Form").Select
          ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
             IgnorePrintAreas:=False
       End If
    End Sub
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

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

    Default Re: VBA Code to prompt a user to print out

    Worked beautifully! Thank you Fluff

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    26,976
    Post Thanks / Like
    Mentioned
    459 Post(s)
    Tagged
    45 Thread(s)

    Default Re: VBA Code to prompt a user to print out

    You're welcome & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

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
  •