{"id":1578,"date":"2023-11-16T11:52:53","date_gmt":"2023-11-16T11:52:53","guid":{"rendered":"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/"},"modified":"2023-12-06T05:50:20","modified_gmt":"2023-12-06T05:50:20","slug":"aantal-lijnen","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/","title":{"rendered":"Hoe maak je rijen met vba in excel?"},"content":{"rendered":"<div class=\"excel-voor-de-inhoud\" id=\"excel-3347436931\"><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>Om rijen te tellen met VBA, moet u het bereik instellen van waaruit u rijen wilt tellen en vervolgens de eigenschap count and rows gebruiken om het aantal rijen uit dat bereik te verkrijgen. U kunt ook een lus gebruiken om rijen te tellen waarin u alleen gegevens heeft.<\/p><h2 class=\"wp-block-heading\"> Gebruik VBA om rijen te tellen<\/h2><ol type=\"1\"><li> Eerst moet u het bereik defini\u00ebren waarvoor u rijen wilt tellen.<\/li><li> Gebruik daarna een punt (.) om de lijst met eigenschappen en methoden te openen.<\/li><li> Typ of selecteer vervolgens de eigenschap &#8216;Lijnen&#8217;.<\/li><li> Gebruik aan het einde de eigenschap &#8220;Count&#8221;. <\/li><\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-58865\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-vba-pour-compter-les-lignes.png\" sizes=\"auto, \" srcset=\"\" alt=\"vba-to-count-rijen\" width=\"422\" height=\"262\"><\/figure><\/div><p> Wanneer u deze code nu uitvoert, wordt het aantal rijen geretourneerd. Om het aantal te verkrijgen, kunt u een <a href=\"https:\/\/exceladvisor.org\/nl\/vba-berichtbox\/\">berichtvenster<\/a> gebruiken of <a href=\"https:\/\/exceladvisor.org\/nl\/cel-waarde\/\">deze waarde ook rechtstreeks in een cel invoeren<\/a> .<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub vba_count_rows() Range(\"A1:A10\").Rows.Count End Sub<\/code><\/pre><h2 class=\"wp-block-heading\"> Tel rijen voor het gebruikte bereik<\/h2><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub vba_count_rows2()   MsgBox Worksheets(\"Sheet1\").UsedRange.Rows.Count End Sub<\/code><\/pre><h2 class=\"wp-block-heading\"> Tel rijen met gegevens met VBA<\/h2><p> U kunt ook rijen tellen die gegevens bevatten, terwijl u lege rijen negeert. <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-58866\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/2-lignes-de-comptage-avec-des-donnees-a-laide-de-vba.png\" sizes=\"auto, \" srcset=\"\" alt=\"tel-rijen-met-gegevens-met-vba\" width=\"627\" height=\"421\"><\/figure><\/div><p> De volgende code neemt het gebruikte bereik als het bereik dat moet worden herhaald en doorloopt elke rij \u00e9\u00e9n voor \u00e9\u00e9n en controleert of daar een niet-lege cel is, en als die er is, beschouwt hij deze als een rij met gegevens, en op aan het einde wordt een berichtvenster weergegeven met het totale aantal regels.<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub vba_count_rows_with_data() Dim counter As Long Dim iRange As Range With ActiveSheet.UsedRange    'loop through each row from the used range    For Each iRange In .Rows        'check if the row contains a cell with a value        If Application.CountA(iRange) &gt; 0 Then            'counts the number of rows non-empty Cells            counter = counter + 1        End If    Next End With MsgBox \"Number of used rows is \" &amp; counter End Sub<\/code><\/pre><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\/karakter-lettertype\/\">Excel VBA-lettertype (kleur, grootte, type en vetgedrukt)<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/verberg-toon-kolomrij\/\">Excel VBA Verberg en toon een kolom of rij<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/bereik-1\/\">Excel VBA-bereik &#8211; Werken met bereik en cellen<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/grenzen\/\">Pas randen toe op een cel met VBA in Excel<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/zoek-de-cel-van-de-kolom-van-de-laatste-rij\/\">Vind de laatste rij, kolom en cel met VBA in Excel<\/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-1578","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 maak ik rijen met VBA in Excel?<\/title>\n<meta name=\"description\" content=\"In deze zelfstudie leert u hoe u VBA kunt gebruiken om het aantal rijen in Excel te tellen uit een celbereik.\" \/>\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\/aantal-lijnen\/\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u25b7 Hoe maak ik rijen met VBA in Excel?\" \/>\n<meta property=\"og:description\" content=\"In deze zelfstudie leert u hoe u VBA kunt gebruiken om het aantal rijen in Excel te tellen uit een celbereik.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T05:50:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-vba-pour-compter-les-lignes.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\/aantal-lijnen\/\",\"url\":\"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/\",\"name\":\"\u25b7 Hoe maak ik rijen met VBA in Excel?\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-vba-pour-compter-les-lignes.png\",\"datePublished\":\"2023-11-16T11:52:53+00:00\",\"dateModified\":\"2023-12-06T05:50:20+00:00\",\"description\":\"In deze zelfstudie leert u hoe u VBA kunt gebruiken om het aantal rijen in Excel te tellen uit een celbereik.\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/#breadcrumb\"},\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/#primaryimage\",\"url\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-vba-pour-compter-les-lignes.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-vba-pour-compter-les-lignes.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/exceladvisor.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe maak je rijen met vba in excel?\"}]},{\"@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 maak ik rijen met VBA in Excel?","description":"In deze zelfstudie leert u hoe u VBA kunt gebruiken om het aantal rijen in Excel te tellen uit een celbereik.","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\/aantal-lijnen\/","og_locale":"nl_NL","og_type":"article","og_title":"\u25b7 Hoe maak ik rijen met VBA in Excel?","og_description":"In deze zelfstudie leert u hoe u VBA kunt gebruiken om het aantal rijen in Excel te tellen uit een celbereik.","og_url":"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-06T05:50:20+00:00","og_image":[{"url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-vba-pour-compter-les-lignes.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\/aantal-lijnen\/","url":"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/","name":"\u25b7 Hoe maak ik rijen met VBA in Excel?","isPartOf":{"@id":"https:\/\/exceladvisor.org\/nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/#primaryimage"},"image":{"@id":"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/#primaryimage"},"thumbnailUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-vba-pour-compter-les-lignes.png","datePublished":"2023-11-16T11:52:53+00:00","dateModified":"2023-12-06T05:50:20+00:00","description":"In deze zelfstudie leert u hoe u VBA kunt gebruiken om het aantal rijen in Excel te tellen uit een celbereik.","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/#breadcrumb"},"inLanguage":"nl-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/"]}]},{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/#primaryimage","url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-vba-pour-compter-les-lignes.png","contentUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-vba-pour-compter-les-lignes.png"},{"@type":"BreadcrumbList","@id":"https:\/\/exceladvisor.org\/nl\/aantal-lijnen\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/exceladvisor.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe maak je rijen met vba in excel?"}]},{"@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\/1578","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=1578"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages\/1578\/revisions"}],"predecessor-version":[{"id":2712,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages\/1578\/revisions\/2712"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/media?parent=1578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}