{"id":2156,"date":"2023-09-28T17:42:56","date_gmt":"2023-09-28T17:42:56","guid":{"rendered":"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/"},"modified":"2023-12-06T05:48:28","modified_gmt":"2023-12-06T05:48:28","slug":"spreadsheet-functie","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/","title":{"rendered":"Hoe gebruik ik de vba-spreadsheetfunctie?"},"content":{"rendered":"<div class=\"excel-voor-de-inhoud\" id=\"excel-1155004312\"><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 class=\"wp-block-heading\"><strong>Belangrijkste opmerkingen<\/strong><\/p><ul><li> U kunt de eigenschap WorksheetFunction gebruiken om toegang te krijgen tot werkbladfuncties voor gebruik in een macro.<\/li><\/ul><h2 class=\"wp-block-heading\"> Hoe u een werkbladfunctie in VBA gebruikt bij het schrijven van een macro<\/h2><p> Gebruik de volgende stappen om een werkbladfunctie in VBA te gebruiken.<\/p><ul><li> Geef eerst de cel op waarin u de waarden wilt invoegen die door de functie worden geretourneerd. <br><img loading=\"lazy\" decoding=\"async\" title=\"1-werkblad-functie-in-vba\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-fonction-de-feuille-de-calcul-en-vba.png\" sizes=\"auto, \" srcset=\"\" alt=\"worksheet-function-in-vba\" width=\"184\" height=\"130\"><\/li><li> Gebruik daarna een gelijkteken (=) en typ Application.WorksheetFunction (zoals u al kunt doen in de Excel-toepassing, kunt u alleen WorksheetFunction gebruiken). <br><img loading=\"lazy\" decoding=\"async\" title=\"2-gebruik-een-is-is-teken\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/2-utiliser-un-signe-egal.png\" sizes=\"auto, \" srcset=\"\" alt=\"use-an-equal-sign\" width=\"356\" height=\"136\"><\/li><li> Vervolgens moet u een punt (.) invoeren, en zodra u dat doet, krijgt u een lijst met functies die u in de spreadsheet heeft. <br><img loading=\"lazy\" decoding=\"async\" title=\"3-je-moet-een-punt invoeren\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/3-vous-devez-entrer-un-point.png\" sizes=\"auto, \" srcset=\"\" alt=\"you-need-to-enter-a-dot\" width=\"402\" height=\"159\"><\/li><li> Laten we vanaf hier de functie TextJoin gebruiken om de tekst in de cellen A1 en B1 samen te voegen. Zo gebruik je een functie in het spreadsheet; wanneer u beginhaakjes invoert, worden de argumenten weergegeven die u in de cel moet opgeven. <br><img loading=\"lazy\" decoding=\"async\" title=\"4-gebruik-de-textjoin-functie\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/4-utiliser-la-fonction-textjoin.png\" sizes=\"auto, \" srcset=\"\" alt=\"use-the-textjoin-function\" width=\"583\" height=\"132\"><\/li><li> Zoals je in de bovenstaande schermafbeelding kunt zien, wordt het argument weergegeven dat je moet opgeven, maar niet de naam van het argument. Je moet dus de argumenten kennen voordat je ze gebruikt. Dit zijn de argumenten die u in TextJoin moet gebruiken. <br><img loading=\"lazy\" decoding=\"async\" title=\"5-argument-voor-gebruik-testjoin\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/5-argument-avant-dutiliser-testjoin.png\" sizes=\"auto, \" srcset=\"\" alt=\"arguement-before-using-testjoin\" width=\"330\" height=\"70\"><\/li><li> Laten we nu argumenten in de functie invoeren. <br><img loading=\"lazy\" decoding=\"async\" title=\"6-voer-argument-in-functie\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/6-entrer-un-argument-dans-la-fonction.png\" sizes=\"auto, \" srcset=\"\" alt=\"enter-arguement-in-the-function\" width=\"506\" height=\"114\"><ol><li> afbakenen: \u00bb \u00ab<\/li><li> negeer_empty: waar<\/li><li> tekst1: Bereik (\u201cA1\u201d)<\/li><li> tekst2: Bereik(\u201cB1\u201d)<\/li><\/ol><\/li><\/ul><p> Hier is de volledige code.<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub MyMacro() Range(\"A1\") = _ Application.WorksheetFunction.TextJoin _ (\" \", True, Range(\"A2\"), Range(\"A3\")) End Sub<\/code><\/pre><p> Er zijn in totaal 387 <a href=\"https:\/\/exceladvisor.org\/nl\/excel-functies\/\">werkbladfuncties<\/a> die u in VBA kunt gebruiken. Maar er zijn enkele functies (bijvoorbeeld: <a href=\"https:\/\/exceladvisor.org\/nl\/excel-tekenreeksfuncties\/\">LEFT<\/a> ) die niet beschikbaar zijn.<\/p><p> Reden? Er zijn <a href=\"https:\/\/exceladvisor.org\/nl\/functies\/\">ingebouwde functies in VBA<\/a> die u kunt gebruiken bij het schrijven van VBA-code. Laten we eens kijken of u een <a href=\"https:\/\/exceladvisor.org\/nl\/vba-berichtbox\/\">berichtvenster<\/a> wilt gebruiken om de waarde van een functie op te halen. Stel dat u de maximale waarde wilt verkrijgen van het bereik met de naam &#8216;myValues&#8217;.<\/p><p> De code zou zijn:<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub MyMacro() MsgBox Prompt:=WorksheetFunction.Max(Range(\"myValues\")) End Sub<\/code><\/pre><p> En zo krijg je een berichtenvenster: <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-51651\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/7-plages-nommees-myvalues.png\" sizes=\"auto, \" srcset=\"\" alt=\"benoemd-bereik-mijnwaarden\" width=\"345\" height=\"255\"><\/figure><\/div><h2 class=\"wp-block-heading\"> Application.WorksheetFunction versus applicatie<\/h2><p> Er zijn twee verschillende manieren om naar een werkbladfunctie te verwijzen. Hieronder staan de twee verschillende coderegels die dezelfde activiteit uitvoeren. <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-51652\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/8-feuille-de-calcul-dapplication-fonction-vs-application.png\" sizes=\"auto, \" srcset=\"\" alt=\"applicatie-werkbladfunctie-vs-applicatie\" width=\"536\" height=\"275\"><\/figure><\/div><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub MyMacro() MsgBox Prompt:= _ Application.WorksheetFunction.Max(Range(\"myValues\")) MsgBox Prompt:= _ Application.Max(Range(\"myValues\")) End Sub<\/code><\/pre><p> Maar er is een voordeel aan het gebruik van de tweede methode. Het retourneert een foutcode in plaats van de fout direct weer te geven.<\/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\/nl\/vba\/\">Wat is VBA<\/a><h2 class=\"gb-headline gb-headline-665e5f6b gb-headline-text gb-headline-mt-heading\"> Gerelateerde 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\/nl\/gemiddeld-2\/\">Gemiddelde waarden in Excel met VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/\">Ontvang de datum van vandaag en de huidige tijd met behulp van VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/som-1\/\">Somwaarden op in Excel met behulp van VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/wedstrijd-2\/\">Match-functie in VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/willekeurig-nummer\/\">VBA willekeurige getallen<\/a> <\/li><\/ul><\/div><\/div><div class=\"gb-grid-column gb-grid-column-50067b57\"><div class=\"gb-container gb-container-50067b57\"><\/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-2156","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>\u25b7 Hoe de VBA-spreadsheetfunctie gebruiken?<\/title>\n<meta name=\"description\" content=\"Deze tutorial laat zien hoe u toegang krijgt tot de spreadsheetevaluatie- en gebruiksfuncties in VBA-code.\" \/>\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\/spreadsheet-functie\/\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u25b7 Hoe de VBA-spreadsheetfunctie gebruiken?\" \/>\n<meta property=\"og:description\" content=\"Deze tutorial laat zien hoe u toegang krijgt tot de spreadsheetevaluatie- en gebruiksfuncties in VBA-code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T05:48:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-fonction-de-feuille-de-calcul-en-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\/spreadsheet-functie\/\",\"url\":\"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/\",\"name\":\"\u25b7 Hoe de VBA-spreadsheetfunctie gebruiken?\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-fonction-de-feuille-de-calcul-en-vba.png\",\"datePublished\":\"2023-09-28T17:42:56+00:00\",\"dateModified\":\"2023-12-06T05:48:28+00:00\",\"description\":\"Deze tutorial laat zien hoe u toegang krijgt tot de spreadsheetevaluatie- en gebruiksfuncties in VBA-code.\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/#breadcrumb\"},\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/#primaryimage\",\"url\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-fonction-de-feuille-de-calcul-en-vba.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-fonction-de-feuille-de-calcul-en-vba.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/exceladvisor.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe gebruik ik de vba-spreadsheetfunctie?\"}]},{\"@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":"\u25b7 Hoe de VBA-spreadsheetfunctie gebruiken?","description":"Deze tutorial laat zien hoe u toegang krijgt tot de spreadsheetevaluatie- en gebruiksfuncties in VBA-code.","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\/spreadsheet-functie\/","og_locale":"nl_NL","og_type":"article","og_title":"\u25b7 Hoe de VBA-spreadsheetfunctie gebruiken?","og_description":"Deze tutorial laat zien hoe u toegang krijgt tot de spreadsheetevaluatie- en gebruiksfuncties in VBA-code.","og_url":"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-06T05:48:28+00:00","og_image":[{"url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-fonction-de-feuille-de-calcul-en-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\/spreadsheet-functie\/","url":"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/","name":"\u25b7 Hoe de VBA-spreadsheetfunctie gebruiken?","isPartOf":{"@id":"https:\/\/exceladvisor.org\/nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/#primaryimage"},"image":{"@id":"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/#primaryimage"},"thumbnailUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-fonction-de-feuille-de-calcul-en-vba.png","datePublished":"2023-09-28T17:42:56+00:00","dateModified":"2023-12-06T05:48:28+00:00","description":"Deze tutorial laat zien hoe u toegang krijgt tot de spreadsheetevaluatie- en gebruiksfuncties in VBA-code.","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/#breadcrumb"},"inLanguage":"nl-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/"]}]},{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/#primaryimage","url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-fonction-de-feuille-de-calcul-en-vba.png","contentUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-fonction-de-feuille-de-calcul-en-vba.png"},{"@type":"BreadcrumbList","@id":"https:\/\/exceladvisor.org\/nl\/spreadsheet-functie\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/exceladvisor.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe gebruik ik de vba-spreadsheetfunctie?"}]},{"@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\/2156","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=2156"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages\/2156\/revisions"}],"predecessor-version":[{"id":2534,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages\/2156\/revisions\/2534"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/media?parent=2156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}