{"id":3629,"date":"2023-09-29T02:30:39","date_gmt":"2023-09-29T02:30:39","guid":{"rendered":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/"},"modified":"2023-12-03T13:05:19","modified_gmt":"2023-12-03T13:05:19","slug":"ausgabe-unter","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/","title":{"rendered":"Wie verwende ich vba exit sub in excel?"},"content":{"rendered":"<div class=\"excel-vor-dem-inhalt\" id=\"excel-4173423004\"><script type=\"text\/javascript\">\r\n\tatOptions = {\r\n\t\t'key' : 'c1158f160081d6540a8409e6925dab94',\r\n\t\t'format' : 'iframe',\r\n\t\t'height' : 250,\r\n\t\t'width' : 300,\r\n\t\t'params' : {}\r\n\t};\r\n<\/script>\r\n<script type=\"text\/javascript\" src=\"\/\/www.highperformanceformat.com\/c1158f160081d6540a8409e6925dab94\/invoke.js\"><\/script><\/div> <p>VBA Exit Sub ist eine Anweisung, mit der Sie eine Unterprozedur oder Funktion beenden. Wie Sie wissen, handelt es sich bei jeder Zeile um ein Makro, das nacheinander ausgef\u00fchrt wird. Wenn Sie das VBA \u201eExit Sub\u201c hinzuf\u00fcgen, beenden Sie die Prozedur, ohne den Rest des darauffolgenden Codes auszuf\u00fchren. Dies funktioniert am besten mit <a href=\"https:\/\/exceladvisor.org\/de\/schleifen\/\">Schleifen<\/a> und der <a href=\"https:\/\/exceladvisor.org\/de\/vba-nachrichtenbox\/\">Meldungsbox<\/a> .<\/p><h2 class=\"wp-block-heading\"> Verwenden der Exit Sub-Anweisung in VBA<\/h2><ol type=\"1\"><li> Entscheiden Sie zun\u00e4chst, in welcher Zeile Sie den \u201eExit Sub\u201c hinzuf\u00fcgen m\u00f6chten.<\/li><li> \u00dcberpr\u00fcfen Sie anschlie\u00dfend die Struktur des Codes, der ausgef\u00fchrt wird, wenn Sie <a href=\"https:\/\/exceladvisor.org\/de\/ein-makro-ausfuhren-2\/\">den Code ausf\u00fchren<\/a> .<\/li><li> Geben Sie als N\u00e4chstes \u201eExit Sub\u201c ein.<\/li><li> Letztendlich ist es am besten, <a href=\"https:\/\/exceladvisor.org\/de\/kommentar\/\">einen Kommentar<\/a> zu haben, der beschreibt, warum Sie die \u201eExit Sub\u201c-Anweisung verwenden. <\/li><\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-55808\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sous-instruction-de-sortie-vba.png\" sizes=\"auto, \" srcset=\"\" alt=\"vba-exit-sub-Anweisung\" width=\"683\" height=\"373\"><\/figure><\/div><p class=\"qt-tip\"> <strong>Hinweis:<\/strong> In einer VBA- <a href=\"https:\/\/exceladvisor.org\/de\/benutzerdefinierte-funktion-2\/\">Funktionsprozedur<\/a> sollten Sie die Anweisung \u201eExit Function\u201c verwenden.<\/p><h2 class=\"wp-block-heading\"> Verwenden Sie Exit Sub mit einem Nachrichtenfeld und einem Eingabefeld<\/h2><p> Angenommen, Sie m\u00f6chten \u00fcber ein Eingabefeld eine Eingabe vom Benutzer erhalten und die Prozedur beenden, wenn die Antwort des Benutzers keine Zahl ist (betrachten Sie das folgende Beispiel). <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-55809\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/2-sorties-sub-avec-une-boite-de-message.png\" sizes=\"auto, \" srcset=\"\" alt=\"\" width=\"686\" height=\"312\"><\/figure><\/div><p> Im obigen Code haben Sie <a href=\"https:\/\/exceladvisor.org\/de\/isnumerisch\/\">ISNUMERIC<\/a> , das den in das Eingabefeld eingegebenen Wert pr\u00fcft, ob es sich um eine Zahl handelt oder nicht, und wenn dieser Wert keine Zahl ist, verwendet es die Exit-Anweisung Sub, um den Vorgang nach der Anzeige eines Meldungsfelds abzuschlie\u00dfen.<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub vba_exit_sub_example() If IsNumeric(InputBox(\"Enter your age.\", \"Age\")) = False Then MsgBox \"Error! Enter your Age in numbers only.\" Exit Sub Else MsgBox \"Thanks for the input.\" End If End Sub<\/code><\/pre><h2 class=\"wp-block-heading\"> Im Fehlerfall Exit Sub<\/h2><p> Das Beste an \u201eExit Sub\u201c ist, dass Sie damit den Vorgang beenden k\u00f6nnen, wenn ein Fehler auftritt. Unten ist der Code, der eine Zahl durch eine Null dividiert, was einen \u201eLaufzeitfehler &#8217;11\u2032\u201c zur\u00fcckgibt und die Ausf\u00fchrung stoppt. <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-55810\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/3-sur-erreur-sortie-sous.png\" sizes=\"auto, \" srcset=\"\" alt=\"\" width=\"491\" height=\"334\"><\/figure><\/div><p> Hier k\u00f6nnen Sie mit der GoTo-Anweisung einen Fehlerhandler mit dem \u201eExit Sub\u201c erstellen, um die Prozedur zu beenden (beachten Sie den folgenden Code). <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-55811\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/4-utiliser-linstruction-goto.png\" sizes=\"auto, \" srcset=\"\" alt=\"\" width=\"520\" height=\"381\"><\/figure><\/div><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub vba_exit_sub_on_error() On Error GoTo iError Range(\"A1\") = 10 \/ 0 iError: MsgBox \"You can't divide with the zero.\" &amp; _ \"Change the code.\" Exit Sub End Sub<\/code><\/pre><p> Im obigen Code haben Sie einen Fehlerhandler, \u201eiError\u201c mit einem Meldungsfeld und dann die Anweisung \u201eExit Sub\u201c. Wenn w\u00e4hrend der Berechnung ein Fehler auftritt, wird die goto-Anweisung an den Fehlerbehandler ( <a href=\"https:\/\/exceladvisor.org\/de\/fehlerbehandlung\/\">VBA Error Handling<\/a> ) \u00fcbergeben und die Prozedur beendet.<\/p><div class=\"gb-container gb-container-4db6181c gb-container-mt\"> <a class=\"gb-button gb-button-c5897111 gb-button-text gb-button-mt-button\" href=\"https:\/\/exceladvisor.org\/de\/vba\/\">Was ist VBA<\/a><h2 class=\"gb-headline gb-headline-665e5f6b gb-headline-text gb-headline-mt-heading\"> Verwandte Tutorials <\/h2><div class=\"gb-grid-wrapper gb-grid-wrapper-a20baf7c gb-grid-wrapper-mt-grid\"><div class=\"gb-grid-column gb-grid-column-65ddf67e\"><div class=\"gb-container gb-container-65ddf67e\"><ul><li> <a href=\"https:\/\/exceladvisor.org\/de\/interview-fragen\/\">Fragen zum VBA-Interview<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/de\/kommentar\/\">F\u00fcgen Sie einen Kommentar im VBA-Code hinzu<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/de\/zeilenumbruch\/\">F\u00fcgen Sie einen Zeilenumbruch im VBA-Code hinzu<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/de\/neue-zeile\/\">F\u00fcgen Sie in VBA eine neue Zeile (Wagenr\u00fccklauf) in eine Zeichenfolge ein<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/de\/ein-makro-ausfuhren-2\/\">F\u00fchren Sie ein Makro in Excel aus (VBA-Code ausf\u00fchren)<\/a><\/li><\/ul><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"ub_ctt_via":"","footnotes":""},"class_list":["post-3629","page","type-page","status-publish","hentry"],"featured_image_src":null,"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Wie verwende ich VBA Exit Sub in Excel? (Tutorial 2023)<\/title>\n<meta name=\"description\" content=\"VBA Exit Sub ist eine Anweisung, mit der Sie eine Unterprozedur oder Funktion beenden. Wie du wei\u00dft,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Wie verwende ich VBA Exit Sub in Excel? (Tutorial 2023)\" \/>\n<meta property=\"og:description\" content=\"VBA Exit Sub ist eine Anweisung, mit der Sie eine Unterprozedur oder Funktion beenden. Wie du wei\u00dft,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-03T13:05:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sous-instruction-de-sortie-vba.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data1\" content=\"2\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/\",\"url\":\"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/\",\"name\":\"Wie verwende ich VBA Exit Sub in Excel? (Tutorial 2023)\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/de\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sous-instruction-de-sortie-vba.png\",\"datePublished\":\"2023-09-29T02:30:39+00:00\",\"dateModified\":\"2023-12-03T13:05:19+00:00\",\"description\":\"VBA Exit Sub ist eine Anweisung, mit der Sie eine Unterprozedur oder Funktion beenden. Wie du wei\u00dft,\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/#primaryimage\",\"url\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sous-instruction-de-sortie-vba.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sous-instruction-de-sortie-vba.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/exceladvisor.org\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Wie verwende ich vba exit sub in excel?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/exceladvisor.org\/de\/#website\",\"url\":\"https:\/\/exceladvisor.org\/de\/\",\"name\":\"Excel Advisor\",\"description\":\"Ihr Leitfaden zur Datendominanz\",\"publisher\":{\"@id\":\"https:\/\/exceladvisor.org\/de\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/exceladvisor.org\/de\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/exceladvisor.org\/de\/#organization\",\"name\":\"Excel Advisor\",\"url\":\"https:\/\/exceladvisor.org\/de\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/exceladvisor.org\/de\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/exceladvisor.org\/de\/wp-content\/uploads\/2023\/11\/exceladvisor.org_.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/de\/wp-content\/uploads\/2023\/11\/exceladvisor.org_.png\",\"width\":105,\"height\":36,\"caption\":\"Excel Advisor\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/de\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Wie verwende ich VBA Exit Sub in Excel? (Tutorial 2023)","description":"VBA Exit Sub ist eine Anweisung, mit der Sie eine Unterprozedur oder Funktion beenden. Wie du wei\u00dft,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/","og_locale":"de_DE","og_type":"article","og_title":"Wie verwende ich VBA Exit Sub in Excel? (Tutorial 2023)","og_description":"VBA Exit Sub ist eine Anweisung, mit der Sie eine Unterprozedur oder Funktion beenden. Wie du wei\u00dft,","og_url":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-03T13:05:19+00:00","og_image":[{"url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sous-instruction-de-sortie-vba.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Gesch\u00e4tzte Lesezeit":"2\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/","url":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/","name":"Wie verwende ich VBA Exit Sub in Excel? (Tutorial 2023)","isPartOf":{"@id":"https:\/\/exceladvisor.org\/de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/#primaryimage"},"image":{"@id":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/#primaryimage"},"thumbnailUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sous-instruction-de-sortie-vba.png","datePublished":"2023-09-29T02:30:39+00:00","dateModified":"2023-12-03T13:05:19+00:00","description":"VBA Exit Sub ist eine Anweisung, mit der Sie eine Unterprozedur oder Funktion beenden. Wie du wei\u00dft,","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/de\/ausgabe-unter\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/#primaryimage","url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sous-instruction-de-sortie-vba.png","contentUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sous-instruction-de-sortie-vba.png"},{"@type":"BreadcrumbList","@id":"https:\/\/exceladvisor.org\/de\/ausgabe-unter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/exceladvisor.org\/de\/"},{"@type":"ListItem","position":2,"name":"Wie verwende ich vba exit sub in excel?"}]},{"@type":"WebSite","@id":"https:\/\/exceladvisor.org\/de\/#website","url":"https:\/\/exceladvisor.org\/de\/","name":"Excel Advisor","description":"Ihr Leitfaden zur Datendominanz","publisher":{"@id":"https:\/\/exceladvisor.org\/de\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exceladvisor.org\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/exceladvisor.org\/de\/#organization","name":"Excel Advisor","url":"https:\/\/exceladvisor.org\/de\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/exceladvisor.org\/de\/#\/schema\/logo\/image\/","url":"https:\/\/exceladvisor.org\/de\/wp-content\/uploads\/2023\/11\/exceladvisor.org_.png","contentUrl":"https:\/\/exceladvisor.org\/de\/wp-content\/uploads\/2023\/11\/exceladvisor.org_.png","width":105,"height":36,"caption":"Excel Advisor"},"image":{"@id":"https:\/\/exceladvisor.org\/de\/#\/schema\/logo\/image\/"}}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/exceladvisor.org\/de\/wp-json\/wp\/v2\/pages\/3629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceladvisor.org\/de\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/exceladvisor.org\/de\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/de\/wp-json\/wp\/v2\/comments?post=3629"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/de\/wp-json\/wp\/v2\/pages\/3629\/revisions"}],"predecessor-version":[{"id":4387,"href":"https:\/\/exceladvisor.org\/de\/wp-json\/wp\/v2\/pages\/3629\/revisions\/4387"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/de\/wp-json\/wp\/v2\/media?parent=3629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}