{"id":1964,"date":"2023-10-26T10:22:15","date_gmt":"2023-10-26T10:22:15","guid":{"rendered":"https:\/\/exceladvisor.org\/nl\/filter\/"},"modified":"2023-12-06T05:46:05","modified_gmt":"2023-12-06T05:46:05","slug":"filter","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/nl\/filter\/","title":{"rendered":"Hoe gebruik ik de vba filter-functie?"},"content":{"rendered":"<div class=\"excel-voor-de-inhoud\" id=\"excel-2561372609\"><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>De VBA FILTER-functie wordt vermeld in de tabelcategorie VBA-functies. Wanneer u het in VBA-code gebruikt, <strong>kan het tekenreeksen retourneren uit een array van tekenreeksen op basis van de tekenreeks die u als subset hebt opgegeven<\/strong> . Simpel gezegd kan het een string specificeren en zal het zoeken naar alle waarden waarbij die string deel uitmaakt van de hoofdstring.<\/p><h2 class=\"wp-block-heading\"> Syntaxis<\/h2><p> <strong>Filter(ArrayBron,Overeenkomen,[Inclusief],[Vergelijken])<\/strong><\/p><h2 class=\"wp-block-heading\"> Argument<\/h2><ul><li> <strong>SourceArray<\/strong> : De array met de tekenreeksen die moeten worden gefilterd.<\/li><li> <strong>Match<\/strong> : de tekenreeks die u wilt filteren in SourceArray.<\/li><li> <strong>[Include]<\/strong> : Dit is een boolean om te defini\u00ebren of de te filteren weerwaarde de overeenkomst bevat, of niet [Dit is een optioneel argument en als dit wordt weggelaten, wordt VBA standaard TRUE].<\/li><li> <strong>[Vergelijk]<\/strong> : een tekenreekswaarde om de vergelijking te defini\u00ebren die moet worden uitgevoerd bij het filteren van de array. [Dit is een optioneel argument en als dit wordt weggelaten, gebruikt VBA standaard vbBinaryCompare].<ul><li> vbBinaryCompare: voor binaire vergelijking.<\/li><li> vbTextCompare: voor tekstvergelijking.<\/li><li> vbDatabaseCompare: voor databasevergelijking.<\/li><\/ul><\/li><\/ul><h2 class=\"wp-block-heading\"> Voorbeeld<\/h2><p> Om praktisch te begrijpen hoe u de VBA FILTER-functie kunt gebruiken, moet u het onderstaande voorbeeld doorlopen waarin we er een vba-code mee hebben geschreven: <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" title=\"voorbeeld-filter-functie-vba\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png\" sizes=\"auto, \" srcset=\"\" alt=\"example-vba-filter-function\" width=\"849\" height=\"588\"><\/figure><\/div><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub example_FILTER() Dim nameAry As Variant Dim myAry(0 To 4) As String myAry(0) = Range(\"A1\").Value myAry(1) = Range(\"A2\").Value myAry(2) = Range(\"A3\").Value myAry(3) = Range(\"A4\").Value myAry(4) = Range(\"A5\").Value nameAry = Filter(myAry, \"Sh\") End Sub<\/code><\/pre><p> In de bovenstaande code hebben we FILTER gebruikt om de waarde uit de array te halen (myAry heeft waarden uit de cellen die we hebben gedefinieerd) die &#8216;Sh&#8217; bevat, en nu bevat &#8216;nameAry&#8217; de &#8216;Jay Sh&#8217; en &#8216;Peter&#8217; Sh\u201d omdat beide \u201cSh\u201d bevatten.<\/p><h2 class=\"wp-block-heading\"> Opmerkingen<\/h2><ul><li> Als de door u opgegeven bronarray NULL is, retourneert VBA een fout.<\/li><li> De door het filter geretourneerde array zal altijd een eendimensionale, op nul gebaseerde array zijn.<\/li><\/ul><div class=\"gb-container gb-container-078e99df gb-container-mt\"> <a class=\"gb-button gb-button-b61bc159 gb-button-text gb-button-mt-button\" href=\"https:\/\/exceladvisor.org\/nl\/vba\/\">Wat is VBA<\/a><h2 class=\"gb-headline gb-headline-eb94b2aa gb-headline-text gb-headline-mt-heading\"> Gerelateerde <a href=\"https:\/\/exceladvisor.org\/nl\/functies\/\">VBA-functies<\/a> <\/h2><div class=\"gb-grid-wrapper gb-grid-wrapper-bea82d60 gb-grid-wrapper-mt-grid\"><div class=\"gb-grid-column gb-grid-column-98a91fbb\"><div class=\"gb-container gb-container-98a91fbb\"><ul><li> <a href=\"https:\/\/exceladvisor.org\/nl\/aanwenden\/\">VBA-TABEL<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/meedoen\/\">WORD LID VAN VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/op-weg\/\">VBA LBOND<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/gesplitst\/\">SPLIT VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/grensoverschrijdend\/\">VBA OVERBOD<\/a> <\/li><\/ul><\/div><\/div><div class=\"gb-grid-column gb-grid-column-3151f7cb\"><div class=\"gb-container gb-container-3151f7cb\"><\/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-1964","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>Hoe gebruik ik de VBA FILTER-functie? (Syntaxis + voorbeeld)<\/title>\n<meta name=\"description\" content=\"Leer hoe u de VBA FILTER-functie gebruikt met syntaxis, argumenten en voorbeelden met voorbeeldcode.\" \/>\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\/nl\/filter\/\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe gebruik ik de VBA FILTER-functie? (Syntaxis + voorbeeld)\" \/>\n<meta property=\"og:description\" content=\"Leer hoe u de VBA FILTER-functie gebruikt met syntaxis, argumenten en voorbeelden met voorbeeldcode.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/nl\/filter\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T05:46:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Geschatte leestijd\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/filter\/\",\"url\":\"https:\/\/exceladvisor.org\/nl\/filter\/\",\"name\":\"Hoe gebruik ik de VBA FILTER-functie? (Syntaxis + voorbeeld)\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/filter\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/filter\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png\",\"datePublished\":\"2023-10-26T10:22:15+00:00\",\"dateModified\":\"2023-12-06T05:46:05+00:00\",\"description\":\"Leer hoe u de VBA FILTER-functie gebruikt met syntaxis, argumenten en voorbeelden met voorbeeldcode.\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/filter\/#breadcrumb\"},\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/nl\/filter\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/filter\/#primaryimage\",\"url\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/filter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/exceladvisor.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe gebruik ik de vba filter-functie?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/#website\",\"url\":\"https:\/\/exceladvisor.org\/nl\/\",\"name\":\"Excel Advisor\",\"description\":\"Uw gids voor datadominantie\",\"publisher\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/exceladvisor.org\/nl\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"nl-NL\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/#organization\",\"name\":\"Excel Advisor\",\"url\":\"https:\/\/exceladvisor.org\/nl\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/exceladvisor.org\/nl\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/nl\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png\",\"width\":105,\"height\":36,\"caption\":\"Excel Advisor\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hoe gebruik ik de VBA FILTER-functie? (Syntaxis + voorbeeld)","description":"Leer hoe u de VBA FILTER-functie gebruikt met syntaxis, argumenten en voorbeelden met voorbeeldcode.","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\/nl\/filter\/","og_locale":"nl_NL","og_type":"article","og_title":"Hoe gebruik ik de VBA FILTER-functie? (Syntaxis + voorbeeld)","og_description":"Leer hoe u de VBA FILTER-functie gebruikt met syntaxis, argumenten en voorbeelden met voorbeeldcode.","og_url":"https:\/\/exceladvisor.org\/nl\/filter\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-06T05:46:05+00:00","og_image":[{"url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Geschatte leestijd":"2 minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/exceladvisor.org\/nl\/filter\/","url":"https:\/\/exceladvisor.org\/nl\/filter\/","name":"Hoe gebruik ik de VBA FILTER-functie? (Syntaxis + voorbeeld)","isPartOf":{"@id":"https:\/\/exceladvisor.org\/nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceladvisor.org\/nl\/filter\/#primaryimage"},"image":{"@id":"https:\/\/exceladvisor.org\/nl\/filter\/#primaryimage"},"thumbnailUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png","datePublished":"2023-10-26T10:22:15+00:00","dateModified":"2023-12-06T05:46:05+00:00","description":"Leer hoe u de VBA FILTER-functie gebruikt met syntaxis, argumenten en voorbeelden met voorbeeldcode.","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/nl\/filter\/#breadcrumb"},"inLanguage":"nl-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/nl\/filter\/"]}]},{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/exceladvisor.org\/nl\/filter\/#primaryimage","url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png","contentUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png"},{"@type":"BreadcrumbList","@id":"https:\/\/exceladvisor.org\/nl\/filter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/exceladvisor.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe gebruik ik de vba filter-functie?"}]},{"@type":"WebSite","@id":"https:\/\/exceladvisor.org\/nl\/#website","url":"https:\/\/exceladvisor.org\/nl\/","name":"Excel Advisor","description":"Uw gids voor datadominantie","publisher":{"@id":"https:\/\/exceladvisor.org\/nl\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exceladvisor.org\/nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"nl-NL"},{"@type":"Organization","@id":"https:\/\/exceladvisor.org\/nl\/#organization","name":"Excel Advisor","url":"https:\/\/exceladvisor.org\/nl\/","logo":{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/exceladvisor.org\/nl\/#\/schema\/logo\/image\/","url":"https:\/\/exceladvisor.org\/nl\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png","contentUrl":"https:\/\/exceladvisor.org\/nl\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png","width":105,"height":36,"caption":"Excel Advisor"},"image":{"@id":"https:\/\/exceladvisor.org\/nl\/#\/schema\/logo\/image\/"}}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages\/1964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/comments?post=1964"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages\/1964\/revisions"}],"predecessor-version":[{"id":2468,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages\/1964\/revisions\/2468"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/media?parent=1964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}