MsgBox and VbYesNo not working for Exit Sub argument

  • The "Yes" and "No" Button MsgBox are both calling my given Sub "Overpaid_L_Grant" which means the Exit Sub is not working for "No". How can I click on the "No" button to exit Sub and "Yes" to just Call the Sub if the Sheets already exists?


  • Try changing the msgbox part of the code to:

    If Not ws Is Nothing Then
      answer = MsgBox("Overpaid_LGrant Already Exists, Do you want to process it again?", vbYesNo + vbInformation)
      If answer = vbYes Then
        Call Overpaid_L_grant
        Exit Sub
      End If
    End If

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!