Results 1 to 2 of 2

Thread: Message Box Pop-Up "yes or no"

  1. #1
    Member Ryan_Bernal's Avatar
    Join Date
    Dec 2012
    Posts
    37
    Rep Power
    0

    Message Box Pop-Up "yes or no"

    I need help.
    I have vba code that print labels and i need to modify the code.
    Before printing the user will ask to print the the document.
    If the user will choose "YES" then continue printing. If the user opt to "NO" it will cancel printing.
    Here is my codes but i don't know how to combine.. Any help will be appreciated.Thanks in advance.
    Code:
    Sub PrintLabels()
    'Please Do not alter any codes Here!
    Dim Labels As Long, Lbl As Long
    
    
    Labels = Sheets("INPUT").[C13]
    
    With Sheets("FORM")
        For Lbl = 1 To Labels Step 2
            .Range("B9") = Lbl
            If Lbl < Labels Then
                .Range("B23") = Lbl + 1
            Else
                .Range("B23") = ""
            End If
            
            .PrintOut Copies:=1
        Next Lbl
    End With
    
    End Sub
    and this code
    Code:
    Sub Print_option()
    
    MSG1 = MsgBox("Are you sure you want to print this document? ", vbYesNo, "SAVE PAPER!Check Before you Print!")
    
    If MSG1 = vbYes Then
      MsgBox "Print"
    Else
      MsgBox "Cancel"
    End If
    
    End Sub

  2. #2
    Member Ryan_Bernal's Avatar
    Join Date
    Dec 2012
    Posts
    37
    Rep Power
    0
    I already found solution for this.
    Thanks.
    Code:
    Sub Print_option()
    If MsgBox("Are you sure you want to print this document? ", vbYesNo, "SAVE PAPER!Check Before you Print!") = vbYes Then
       PrintLabels
    Else
      MsgBox "Printing Cancelled!"
    End If
    End Sub

Similar Threads

  1. VBA Versions of my "Get Field" and "Get Reverse Field" formulas
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 4
    Last Post: 06-02-2017, 06:15 PM
  2. Reversing a "First Middle Last" Name to "Last, First Middle" Name Format
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 5
    Last Post: 01-06-2014, 10:04 PM
  3. Replies: 5
    Last Post: 04-18-2013, 02:30 AM
  4. Follow-up to "Excel Number Format: Indian Style Comma Separation"
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 2
    Last Post: 04-14-2012, 10:46 PM
  5. Ordinal Suffix (i.e., "st", "nd", "rd" and "th")
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 0
    Last Post: 03-20-2012, 03:46 AM

Posting Permissions

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