{"id":4972,"date":"2023-07-05T18:29:08","date_gmt":"2023-07-05T18:29:08","guid":{"rendered":"https:\/\/statorials.org\/nl\/vba-fout\/"},"modified":"2023-07-05T18:29:08","modified_gmt":"2023-07-05T18:29:08","slug":"vba-fout","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/vba-fout\/","title":{"rendered":"Hoe de iserror-functie in vba te gebruiken (met voorbeeld)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">U kunt de functie <strong>IsError<\/strong> in VBA gebruiken om te controleren of een bepaalde cel een foutwaarde bevat en dienovereenkomstig <b>TRUE<\/b> of <b>FALSE<\/b> retourneren.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Hier is een gebruikelijke manier om deze functie in de praktijk te gebruiken:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #0000ff;\">SubCheckIsError<\/span> ()\n\n<span style=\"color: #0000ff;\">Dim<\/span> i <span style=\"color: #0000ff;\">As<\/span> Integer\n    \n<span style=\"color: #0000ff;\">For<\/span> i = 2 <span style=\"color: #0000ff;\">To<\/span> 11\n    Range(\"B\" &amp; i).Value = WorksheetFunction.IsError(Range(\"A\" &amp; i))\n<span style=\"color: #0000ff;\">Next<\/span> i\n\n<span style=\"color: #0000ff;\">End Sub\n<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Deze specifieke macro controleert of elke cel in het bereik <strong>A2:A11<\/strong> een foutwaarde is en retourneert <strong>TRUE<\/strong> of <strong>FALSE<\/strong> in de overeenkomstige cel in het bereik <strong>B2:B11<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">Het volgende voorbeeld laat zien hoe u deze syntaxis in de praktijk kunt gebruiken.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Voorbeeld: hoe u de IsError-functie in VBA gebruikt<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Stel dat we de volgende kolom met waarden in Excel hebben:<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-38784 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/cheque1.png\" alt=\"\" width=\"436\" height=\"368\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Stel dat we willen controleren of elke waarde in kolom A een foutwaarde is of niet.<\/span><\/p>\n<p> <span style=\"color: #000000;\">We kunnen hiervoor de volgende macro maken:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #0000ff;\">SubCheckIsError<\/span> ()\n\n<span style=\"color: #0000ff;\">Dim<\/span> i <span style=\"color: #0000ff;\">As<\/span> Integer\n    \n<span style=\"color: #0000ff;\">For<\/span> i = 2 <span style=\"color: #0000ff;\">To<\/span> 11\n    Range(\"B\" &amp; i).Value = WorksheetFunction.IsError(Range(\"A\" &amp; i))\n<span style=\"color: #0000ff;\">Next<\/span> i\n\n<span style=\"color: #0000ff;\">End Sub<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Wanneer we deze macro uitvoeren, ontvangen we de volgende uitvoer:<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-38785 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/cheque2.png\" alt=\"\" width=\"447\" height=\"423\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Waarden in kolom B geven <strong>WAAR<\/strong> of <strong>ONWAAR<\/strong> weer om aan te geven of de overeenkomstige waarden in kolom A al dan niet foutwaarden zijn.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Merk op dat de volgende waarden allemaal <strong>WAAR<\/strong> retourneren in kolom B:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>#DIV\/0!<\/strong><\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>#WAARDE!<\/strong><\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>#NUM!<\/strong><\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Alle andere waarden retourneren <strong>FALSE<\/strong> omdat het geen foutwaarden zijn.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Houd er ook rekening mee dat lege cel <strong>A10<\/strong> niet <strong>WAAR<\/strong> retourneert, omdat het geen foutwaarde is; het is gewoon leeg.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Opmerking<\/strong> : u kunt <a href=\"https:\/\/learn.microsoft.com\/en-us\/office\/vba\/language\/reference\/user-interface-help\/iserror-function\" target=\"_blank\" rel=\"noopener\">hier<\/a> de volledige documentatie voor de VBA <strong>IsError-<\/strong> functie vinden.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">In de volgende tutorials wordt uitgelegd hoe u andere veelvoorkomende taken in VBA kunt uitvoeren:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><a href=\"https:\/\/statorials.org\/nl\/vba-als-of\/\" target=\"_blank\" rel=\"noopener\">VBA: IF OR gebruiken om meerdere voorwaarden te testen<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/vba-als-en\/\" target=\"_blank\" rel=\"noopener\">VBA: IF AND gebruiken om meerdere voorwaarden te testen<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/vba-anders\/\" target=\"_blank\" rel=\"noopener\">VBA: IF NOT gebruiken om te testen of niet aan de voorwaarde is voldaan<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>U kunt de functie IsError in VBA gebruiken om te controleren of een bepaalde cel een foutwaarde bevat en dienovereenkomstig TRUE of FALSE retourneren. Hier is een gebruikelijke manier om deze functie in de praktijk te gebruiken: SubCheckIsError () Dim i As Integer For i = 2 To 11 Range(&#8222;B&#8220; &amp; i).Value = WorksheetFunction.IsError(Range(&#8222;A&#8220; &amp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-4972","post","type-post","status-publish","format-standard","hentry","category-gids"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Hoe de IsError-functie in VBA te gebruiken (met voorbeeld) - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt aan de hand van een voorbeeld uitgelegd hoe u de functie IsError in VBA gebruikt.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/nl\/vba-fout\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe de IsError-functie in VBA te gebruiken (met voorbeeld) - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt aan de hand van een voorbeeld uitgelegd hoe u de functie IsError in VBA gebruikt.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/vba-fout\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-05T18:29:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/cheque1.png\" \/>\n<meta name=\"author\" content=\"Dr.benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/vba-fout\/\",\"url\":\"https:\/\/statorials.org\/nl\/vba-fout\/\",\"name\":\"Hoe de IsError-functie in VBA te gebruiken (met voorbeeld) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-05T18:29:08+00:00\",\"dateModified\":\"2023-07-05T18:29:08+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt aan de hand van een voorbeeld uitgelegd hoe u de functie IsError in VBA gebruikt.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/vba-fout\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/vba-fout\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/vba-fout\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe de iserror-functie in vba te gebruiken (met voorbeeld)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/nl\/#website\",\"url\":\"https:\/\/statorials.org\/nl\/\",\"name\":\"Statorials\",\"description\":\"Uw gids voor statistische competentie\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder\",\"sameAs\":[\"http:\/\/statorials.org\/nl\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hoe de IsError-functie in VBA te gebruiken (met voorbeeld) - Statorials","description":"In deze tutorial wordt aan de hand van een voorbeeld uitgelegd hoe u de functie IsError in VBA gebruikt.","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:\/\/statorials.org\/nl\/vba-fout\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe de IsError-functie in VBA te gebruiken (met voorbeeld) - Statorials","og_description":"In deze tutorial wordt aan de hand van een voorbeeld uitgelegd hoe u de functie IsError in VBA gebruikt.","og_url":"https:\/\/statorials.org\/nl\/vba-fout\/","og_site_name":"Statorials","article_published_time":"2023-07-05T18:29:08+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/cheque1.png"}],"author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"2\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/vba-fout\/","url":"https:\/\/statorials.org\/nl\/vba-fout\/","name":"Hoe de IsError-functie in VBA te gebruiken (met voorbeeld) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-05T18:29:08+00:00","dateModified":"2023-07-05T18:29:08+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt aan de hand van een voorbeeld uitgelegd hoe u de functie IsError in VBA gebruikt.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/vba-fout\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/vba-fout\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/vba-fout\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe de iserror-functie in vba te gebruiken (met voorbeeld)"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/nl\/#website","url":"https:\/\/statorials.org\/nl\/","name":"Statorials","description":"Uw gids voor statistische competentie","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder","sameAs":["http:\/\/statorials.org\/nl"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/4972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/comments?post=4972"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/4972\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=4972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=4972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=4972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}