{"id":1578,"date":"2023-11-16T11:52:53","date_gmt":"2023-11-16T11:52:53","guid":{"rendered":"https:\/\/exceladvisor.org\/id\/jumlah-baris\/"},"modified":"2023-12-06T06:13:20","modified_gmt":"2023-12-06T06:13:20","slug":"jumlah-baris","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/id\/jumlah-baris\/","title":{"rendered":"Bagaimana cara membuat baris menggunakan vba di excel?"},"content":{"rendered":"<div class=\"excel-before-content\" id=\"excel-2458217819\"><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>Untuk menghitung baris menggunakan VBA, Anda perlu mengatur rentang yang ingin Anda hitung barisnya, lalu gunakan properti count dan baris untuk mendapatkan jumlah baris dari rentang tersebut. Anda juga dapat menggunakan loop untuk menghitung baris di mana Anda hanya memiliki data.<\/p><h2 class=\"wp-block-heading\"> Gunakan VBA untuk menghitung baris<\/h2><ol type=\"1\"><li> Pertama, Anda perlu menentukan rentang baris yang ingin Anda hitung.<\/li><li> Setelah itu, gunakan titik (.) untuk membuka daftar properti dan metode.<\/li><li> Selanjutnya, ketik atau pilih properti \u201cGaris\u201d.<\/li><li> Pada akhirnya, gunakan properti &#8220;Hitungan&#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-untuk-menghitung-baris\" width=\"422\" height=\"262\"><\/figure><\/div><p> Sekarang ketika Anda menjalankan kode ini, ia akan mengembalikan jumlah baris, dan untuk mendapatkan nomor tersebut Anda dapat menggunakan <a href=\"https:\/\/exceladvisor.org\/id\/kotak-pesan-vba\/\">kotak pesan<\/a> atau <a href=\"https:\/\/exceladvisor.org\/id\/nilai-sel\/\">langsung memasukkan nilai ini ke dalam sel<\/a> juga.<\/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\"> Hitung baris untuk rentang yang digunakan<\/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\"> Hitung baris dengan data menggunakan VBA<\/h2><p> Anda juga dapat menghitung baris yang berisi data sambil mengabaikan baris kosong. <\/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=\"hitung-baris-dengan-data-menggunakan-vba\" width=\"627\" height=\"421\"><\/figure><\/div><p> Kode berikut akan mengambil rentang yang digunakan sebagai rentang yang akan diulang dan menelusuri setiap baris satu per satu dan memeriksa apakah ada sel yang tidak kosong di sana, dan jika ada, ia akan menganggapnya sebagai baris dengan data, dan di bagian akhir menunjukkan kotak pesan dengan jumlah baris.<\/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\/id\/vba\/\">Apa itu VBA<\/a><h2 class=\"gb-headline gb-headline-665e5f6b gb-headline-text gb-headline-mt-heading\"> Tutorial terkait <\/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\/id\/huruf-karakter\/\">Font Excel VBA (warna, ukuran, jenis dan tebal)<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/id\/sembunyikan-tampilkan-baris-kolom\/\">Excel VBA Sembunyikan dan tampilkan kolom atau baris<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/id\/rentang-1\/\">Rentang VBA Excel \u2013 Bekerja dengan Rentang dan Sel<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/id\/perbatasan\/\">Terapkan batas ke sel menggunakan VBA di Excel<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/id\/temukan-sel-kolom-baris-terakhir\/\">Temukan Baris, Kolom, dan Sel Terakhir Menggunakan VBA di 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 Bagaimana cara membuat baris menggunakan VBA di Excel?<\/title>\n<meta name=\"description\" content=\"Pada tutorial ini, Anda akan mempelajari cara menggunakan VBA untuk menghitung jumlah baris di Excel dari suatu range sel, a\" \/>\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\/id\/jumlah-baris\/\" \/>\n<meta property=\"og:locale\" content=\"id_ID\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u25b7 Bagaimana cara membuat baris menggunakan VBA di Excel?\" \/>\n<meta property=\"og:description\" content=\"Pada tutorial ini, Anda akan mempelajari cara menggunakan VBA untuk menghitung jumlah baris di Excel dari suatu range sel, a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/id\/jumlah-baris\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T06:13: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=\"Estimasi waktu membaca\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 menit\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/exceladvisor.org\/id\/jumlah-baris\/\",\"url\":\"https:\/\/exceladvisor.org\/id\/jumlah-baris\/\",\"name\":\"\u25b7 Bagaimana cara membuat baris menggunakan VBA di Excel?\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/id\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/exceladvisor.org\/id\/jumlah-baris\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/id\/jumlah-baris\/#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-06T06:13:20+00:00\",\"description\":\"Pada tutorial ini, Anda akan mempelajari cara menggunakan VBA untuk menghitung jumlah baris di Excel dari suatu range sel, a\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/id\/jumlah-baris\/#breadcrumb\"},\"inLanguage\":\"id\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/id\/jumlah-baris\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\/\/exceladvisor.org\/id\/jumlah-baris\/#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\/id\/jumlah-baris\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Rumah\",\"item\":\"https:\/\/exceladvisor.org\/id\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bagaimana cara membuat baris menggunakan vba di excel?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/exceladvisor.org\/id\/#website\",\"url\":\"https:\/\/exceladvisor.org\/id\/\",\"name\":\"Excel Advisor\",\"description\":\"Panduan utama Anda untuk mendominasi data!\",\"publisher\":{\"@id\":\"https:\/\/exceladvisor.org\/id\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/exceladvisor.org\/id\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"id\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/exceladvisor.org\/id\/#organization\",\"name\":\"Excel Advisor\",\"url\":\"https:\/\/exceladvisor.org\/id\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\/\/exceladvisor.org\/id\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/exceladvisor.org\/id\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/id\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png\",\"width\":105,\"height\":36,\"caption\":\"Excel Advisor\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/id\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u25b7 Bagaimana cara membuat baris menggunakan VBA di Excel?","description":"Pada tutorial ini, Anda akan mempelajari cara menggunakan VBA untuk menghitung jumlah baris di Excel dari suatu range sel, a","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\/id\/jumlah-baris\/","og_locale":"id_ID","og_type":"article","og_title":"\u25b7 Bagaimana cara membuat baris menggunakan VBA di Excel?","og_description":"Pada tutorial ini, Anda akan mempelajari cara menggunakan VBA untuk menghitung jumlah baris di Excel dari suatu range sel, a","og_url":"https:\/\/exceladvisor.org\/id\/jumlah-baris\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-06T06:13: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":{"Estimasi waktu membaca":"2 menit"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/exceladvisor.org\/id\/jumlah-baris\/","url":"https:\/\/exceladvisor.org\/id\/jumlah-baris\/","name":"\u25b7 Bagaimana cara membuat baris menggunakan VBA di Excel?","isPartOf":{"@id":"https:\/\/exceladvisor.org\/id\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceladvisor.org\/id\/jumlah-baris\/#primaryimage"},"image":{"@id":"https:\/\/exceladvisor.org\/id\/jumlah-baris\/#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-06T06:13:20+00:00","description":"Pada tutorial ini, Anda akan mempelajari cara menggunakan VBA untuk menghitung jumlah baris di Excel dari suatu range sel, a","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/id\/jumlah-baris\/#breadcrumb"},"inLanguage":"id","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/id\/jumlah-baris\/"]}]},{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/exceladvisor.org\/id\/jumlah-baris\/#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\/id\/jumlah-baris\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Rumah","item":"https:\/\/exceladvisor.org\/id\/"},{"@type":"ListItem","position":2,"name":"Bagaimana cara membuat baris menggunakan vba di excel?"}]},{"@type":"WebSite","@id":"https:\/\/exceladvisor.org\/id\/#website","url":"https:\/\/exceladvisor.org\/id\/","name":"Excel Advisor","description":"Panduan utama Anda untuk mendominasi data!","publisher":{"@id":"https:\/\/exceladvisor.org\/id\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exceladvisor.org\/id\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"id"},{"@type":"Organization","@id":"https:\/\/exceladvisor.org\/id\/#organization","name":"Excel Advisor","url":"https:\/\/exceladvisor.org\/id\/","logo":{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/exceladvisor.org\/id\/#\/schema\/logo\/image\/","url":"https:\/\/exceladvisor.org\/id\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png","contentUrl":"https:\/\/exceladvisor.org\/id\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png","width":105,"height":36,"caption":"Excel Advisor"},"image":{"@id":"https:\/\/exceladvisor.org\/id\/#\/schema\/logo\/image\/"}}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/pages\/1578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/comments?post=1578"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/pages\/1578\/revisions"}],"predecessor-version":[{"id":2281,"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/pages\/1578\/revisions\/2281"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/media?parent=1578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}