+ Reply to Thread
Results 1 to 7 of 7

continue code

Hybrid View

  1. #1
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481
    Try this, although if the user may not have selected the system of delivery when the code is run for the second time.

    Is there no way you can check that the delivery system has been chosen?

    Private m_blnRunningMacro  As Boolean
    Sub PRINTSUPPLYONLY()
        
        Dim lngAns As VbMsgBoxResult
        
        If Not m_blnRunningMacro Then
        
            lngAns = MsgBox("HAVE YOU SELECTED THE SYSTEM IN THE DELIVERY SHEET?", _
                            vbYesNo Or vbQuestion Or vbDefaultButton1, "Delivery sheet")
        Else
            lngAns = vbYes
            m_blnRunningMacro = False
        End If
        
        Select Case lngAns
        Case vbYes
            Sheets("Delivery note").Select
            MsgBox "PLEASE INSERT 1 SHEET OF HEADED PAPER!"
            Sheets("Receipt of deposit letter").Select
            ExecuteExcel4Macro "PRINT(1,,,2,,,,,,,,2,,,TRUE,,FALSE)"
            Sheets("Job Sheet").Select
            ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
            Sheets("Delivery note").Select
            ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
        Case vbNo
            Sheets("Delivery note").Select
            Range("B16").Select
                
            m_blnRunningMacro = True
            
            Exit Sub
        End Select
        
    End Sub
    Cheers
    Andy
    www.andypope.info

  2. #2
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi andy

    willc heck this when i get home
    thanks for the reply
    basically there are only a couple of users for this form so thats not really an issue

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1