{"id":4472,"date":"2023-07-10T20:42:32","date_gmt":"2023-07-10T20:42:32","guid":{"rendered":"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/"},"modified":"2023-07-10T20:42:32","modified_gmt":"2023-07-10T20:42:32","slug":"vba-telt-rijen-in-tabel","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/","title":{"rendered":"Rijen in een tabel tellen met vba (met voorbeeld)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">U kunt de volgende syntaxis gebruiken om het aantal rijen in een tabel in Excel te tellen met behulp van VBA:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #0000ff;\">SubCountTableRow<\/span> ()\n\n<span style=\"color: #0000ff;\">Dim<\/span> tbl <span style=\"color: #0000ff;\">As<\/span> ListObject\n\n<span style=\"color: #008000;\">'specify table to count rows in\n<\/span><span style=\"color: #0000ff;\">Set<\/span> tbl = ActiveSheet.ListObjects(\" <span style=\"color: #ff0000;\">Table1<\/span> \")\n\n<span style=\"color: #008000;\">'create message box that displays row count\n<\/span>MsgBox \" <span style=\"color: #ff0000;\">Total Rows:<\/span> \" &amp; tbl.Range.Rows.Count &amp; vbNewLine &amp; _\n       \" <span style=\"color: #ff0000;\">Header Rows:<\/span> \" &amp; tbl.HeaderRowRange.Rows.Count &amp; vbNewLine &amp; _\n       \" <span style=\"color: #ff0000;\">Body Rows:<\/span> \" &amp; tbl.ListRows.Count\n\n<span style=\"color: #008000;\">'set tbl variable to Nothing\n<\/span><span style=\"color: #0000ff;\">Set<\/span> tbl = Nothing\n\n<span style=\"color: #0000ff;\">End Sub\n<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Dit specifieke voorbeeld telt het volgende aantal rijen voor de tabel op het actieve blad genaamd <strong>Tabel1<\/strong> :<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Totaal aantal regels<\/span><\/li>\n<li> <span style=\"color: #000000;\">Totaal aantal kopregels<\/span><\/li>\n<li> <span style=\"color: #000000;\">Totaal aantal lichaamslijnen<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">We gebruiken de <strong>MsgBox-<\/strong> functie om een berichtenvenster te maken waarin elk van deze waarden in \u00e9\u00e9n berichtvenster wordt weergegeven.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Opmerking<\/strong> : we gebruiken de <strong>vbNewLine-<\/strong> instructie om nieuwe regels in te voegen en een berichtenvenster met meerdere regels te maken.<\/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: rijen in een tabel tellen met VBA<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Stel dat we de volgende tabel hebben, genaamd <strong>Tabel1<\/strong> , die informatie bevat over verschillende basketbalspelers:<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-34987 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/compte1.png\" alt=\"\" width=\"578\" height=\"500\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">We kunnen de volgende macro maken om het aantal rijen in deze tabel te tellen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #0000ff;\">SubCountTableRow<\/span> ()\n\n<span style=\"color: #0000ff;\">Dim<\/span> tbl <span style=\"color: #0000ff;\">As<\/span> ListObject\n\n<span style=\"color: #008000;\">'specify table to count rows in\n<\/span><span style=\"color: #0000ff;\">Set<\/span> tbl = ActiveSheet.ListObjects(\" <span style=\"color: #ff0000;\">Table1<\/span> \")\n\n<span style=\"color: #008000;\">'create message box that displays row count\n<\/span>MsgBox \" <span style=\"color: #ff0000;\">Total Rows:<\/span> \" &amp; tbl.Range.Rows.Count &amp; vbNewLine &amp; _\n       \" <span style=\"color: #ff0000;\">Header Rows:<\/span> \" &amp; tbl.HeaderRowRange.Rows.Count &amp; vbNewLine &amp; _\n       \" <span style=\"color: #ff0000;\">Body Rows:<\/span> \" &amp; tbl.ListRows.Count\n\n<span style=\"color: #008000;\">'set tbl variable to Nothing\n<\/span><span style=\"color: #0000ff;\">Set<\/span> tbl = Nothing\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-34988 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/compte2.png\" alt=\"\" width=\"528\" height=\"478\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">Het berichtvenster vertelt ons dat er in totaal <strong>10<\/strong> rijen in de tabel staan.<\/span><\/span><\/p>\n<p> <span style=\"color: #000000;\">Dit vertelt ons ook dat er <strong>1<\/strong> koprij en <strong>9<\/strong> hoofdrijen zijn.<\/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> <a href=\"https:\/\/statorials.org\/nl\/vba-telling-uniek\/\" target=\"_blank\" rel=\"noopener\">Hoe u unieke waarden binnen bereik kunt tellen met VBA<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/vba-telt-rijen-binnen-bereik\/\" target=\"_blank\" rel=\"noopener\">Hoe u het aantal rijen in een bereik kunt tellen met VBA<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/vba-telt-cellen-met-specifieke-tekst\/\" target=\"_blank\" rel=\"noopener\">Hoe cellen met specifieke tekst te tellen met VBA<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>U kunt de volgende syntaxis gebruiken om het aantal rijen in een tabel in Excel te tellen met behulp van VBA: SubCountTableRow () Dim tbl As ListObject &#8217;specify table to count rows in Set tbl = ActiveSheet.ListObjects(&#8220; Table1 &#8222;) &#8218;create message box that displays row count MsgBox &#8220; Total Rows: &#8220; &amp; tbl.Range.Rows.Count &amp; vbNewLine [&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-4472","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>Rijen in een tabel tellen met VBA (met voorbeeld) - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt aan de hand van een voorbeeld uitgelegd hoe u het aantal rijen in een tabel kunt tellen met VBA.\" \/>\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-telt-rijen-in-tabel\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Rijen in een tabel tellen met VBA (met voorbeeld) - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt aan de hand van een voorbeeld uitgelegd hoe u het aantal rijen in een tabel kunt tellen met VBA.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-10T20:42:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/compte1.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-telt-rijen-in-tabel\/\",\"url\":\"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/\",\"name\":\"Rijen in een tabel tellen met VBA (met voorbeeld) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-10T20:42:32+00:00\",\"dateModified\":\"2023-07-10T20:42:32+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 het aantal rijen in een tabel kunt tellen met VBA.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Rijen in een tabel tellen met vba (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":"Rijen in een tabel tellen met VBA (met voorbeeld) - Statorials","description":"In deze tutorial wordt aan de hand van een voorbeeld uitgelegd hoe u het aantal rijen in een tabel kunt tellen met VBA.","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-telt-rijen-in-tabel\/","og_locale":"de_DE","og_type":"article","og_title":"Rijen in een tabel tellen met VBA (met voorbeeld) - Statorials","og_description":"In deze tutorial wordt aan de hand van een voorbeeld uitgelegd hoe u het aantal rijen in een tabel kunt tellen met VBA.","og_url":"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/","og_site_name":"Statorials","article_published_time":"2023-07-10T20:42:32+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/compte1.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-telt-rijen-in-tabel\/","url":"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/","name":"Rijen in een tabel tellen met VBA (met voorbeeld) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-10T20:42:32+00:00","dateModified":"2023-07-10T20:42:32+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 het aantal rijen in een tabel kunt tellen met VBA.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/vba-telt-rijen-in-tabel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Rijen in een tabel tellen met vba (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\/4472","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=4472"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/4472\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=4472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=4472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=4472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}