I type in the start date and the end date and execute a code of export from Outlook.
Sub ExportFromOutlook() Dim dteStart As Date Dim dteEnd As Date dteStart = InputBox("What is the start date?", "Export Outlook Calendar") dteEnd = InputBox("What is the end date?", "Export Outlook Calendar") Call GetCalData(dteStart, dteEnd) End Sub I want when I press the "Cancel button" on any of the Inputboxes to exit the sub, not to get an error in the VBA code to debug it.
Cancel, then Exit sub.