{"id":1650,"date":"2023-11-13T20:26:28","date_gmt":"2023-11-13T20:26:28","guid":{"rendered":"https:\/\/exceladvisor.org\/id\/lembar-bening\/"},"modified":"2023-12-06T06:19:27","modified_gmt":"2023-12-06T06:19:27","slug":"lembar-bening","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/id\/lembar-bening\/","title":{"rendered":"Bagaimana cara menghapus seluruh lembar menggunakan vba?"},"content":{"rendered":"<div class=\"excel-before-content\" id=\"excel-1817498202\"><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 menghapus seluruh lembar menggunakan kode VBA sekaligus, Anda perlu menggunakan dua hal, pertama adalah metode CLEAR dan kemudian CELLS untuk merujuk ke semua sel di lembar kerja.<\/p><h2 class=\"wp-block-heading\"> Hapus lembar aktif<\/h2><p> Katakanlah jika Anda ingin menghapus semua isi lembar aktivasi, kodenya akan seperti di bawah ini.<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Cells.Clear<\/code><\/pre><p> Ketika Anda menjalankan kode ini, kode ini akan menghapus semuanya dari semua sel di lembar aktif, seperti yang telah saya sebutkan, kami menggunakan clear untuk merujuk ke seluruh lembar kerja dan clear untuk menghapusnya.<\/p><h2 class=\"wp-block-heading\"> Hapus lembar tertentu<\/h2><p> Ada satu hal yang harus Anda perhatikan bahwa untuk menghapus suatu sheet, sheet tersebut harus diaktifkan. Jadi misalkan Anda ingin menghapus &#8220;Sheet1&#8221;, kodenya akan seperti:<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sheets(\"Sheet1\").Activate Cells.Clear<\/code><\/pre><p> Dalam kode ini, baris pertama mengaktifkan \u201cSheet1\u201d dan baris kedua menghapus semuanya.<\/p><h2 class=\"wp-block-heading\"> Hal-hal lain yang perlu dibersihkan<\/h2><p> Anda juga dapat menggunakan metode di bawah ini untuk menghapus berbagai hal.<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Cells.ClearContents 'to clear contents Cells.ClearComments 'to clear Comments Cells.ClearFormats 'to clears formatting Cells.ClearHyperlinks 'to clear hyperlinks Cells.ClearNotes 'to clear notes Cells.ClearOutline 'to clears outline<\/code><\/pre><h2 class=\"wp-block-heading\"> Hapus lembar dari buku kerja tertentu<\/h2><p> Kode di bawah ini bisa merujuk ke buku kerja &#8220;Buku1&#8221; dan menghapus lembar &#8220;Lembar1&#8221;. Namun pastikan buku kerja terbuka pada saat <a href=\"https:\/\/exceladvisor.org\/id\/jalankan-makro-2\/\">menjalankan kode ini<\/a> .<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Workbooks(\"Book1\").Sheets(\"Sheet1\").Activate Cells.Clear<\/code><\/pre><p> Kode ini pertama-tama mengaktifkan \u201cSheet1\u201d buku dan menghapusnya.<\/p><h2 class=\"wp-block-heading\"> Hapus lembar dari buku kerja yang tertutup<\/h2><p> Dan pada kode di bawah ini, kita mengacu pada &#8220;Sheet1&#8221; dari &#8220;file sampel&#8221; buku kerja, yang disimpan di lokasi tertentu.<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub vba_clear_sheet() Dim wb As Workbook Application.ScreenUpdating = False Set wb = Workbooks.Open(\"C:\\Users\\Dell\\Desktop\\sample-file.xlsx\") wb.Sheets(\"Sheet1\").Activate Cells.Clear wb.Close SaveChanges:=True Application.ScreenUpdating = False 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\/lembar-salinan\/\">Salin dan pindahkan lembar di Excel menggunakan VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/id\/menghitung-daunnya\/\">COUNT Lembar menggunakan VBA di Excel<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/id\/menghapus-lembar-1\/\">HAPUS LEMBAR menggunakan VBA di Excel<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/id\/lembar-sembunyikan\/\">Sembunyikan dan tampilkan lembar menggunakan VBA di Excel<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/id\/melindungi-daunnya\/\">PROTECT dan UNPROTECT sheet menggunakan VBA di Excel<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/id\/ganti-nama-lembar\/\">GANTI NAMA lembar 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-1650","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>Bagaimana cara MENGHAPUS seluruh lembar menggunakan VBA di Excel?<\/title>\n<meta name=\"description\" content=\"Tutorial ini menunjukkan cara menghapus seluruh spreadsheet menggunakan kode VBA. Ini juga menunjukkan kepada Anda cara yang berbeda\" \/>\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\/lembar-bening\/\" \/>\n<meta property=\"og:locale\" content=\"id_ID\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bagaimana cara MENGHAPUS seluruh lembar menggunakan VBA di Excel?\" \/>\n<meta property=\"og:description\" content=\"Tutorial ini menunjukkan cara menghapus seluruh spreadsheet menggunakan kode VBA. Ini juga menunjukkan kepada Anda cara yang berbeda\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/id\/lembar-bening\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T06:19:27+00:00\" \/>\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\/lembar-bening\/\",\"url\":\"https:\/\/exceladvisor.org\/id\/lembar-bening\/\",\"name\":\"Bagaimana cara MENGHAPUS seluruh lembar menggunakan VBA di Excel?\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/id\/#website\"},\"datePublished\":\"2023-11-13T20:26:28+00:00\",\"dateModified\":\"2023-12-06T06:19:27+00:00\",\"description\":\"Tutorial ini menunjukkan cara menghapus seluruh spreadsheet menggunakan kode VBA. Ini juga menunjukkan kepada Anda cara yang berbeda\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/id\/lembar-bening\/#breadcrumb\"},\"inLanguage\":\"id\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/id\/lembar-bening\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/exceladvisor.org\/id\/lembar-bening\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Rumah\",\"item\":\"https:\/\/exceladvisor.org\/id\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bagaimana cara menghapus seluruh lembar menggunakan vba?\"}]},{\"@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":"Bagaimana cara MENGHAPUS seluruh lembar menggunakan VBA di Excel?","description":"Tutorial ini menunjukkan cara menghapus seluruh spreadsheet menggunakan kode VBA. Ini juga menunjukkan kepada Anda cara yang berbeda","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\/lembar-bening\/","og_locale":"id_ID","og_type":"article","og_title":"Bagaimana cara MENGHAPUS seluruh lembar menggunakan VBA di Excel?","og_description":"Tutorial ini menunjukkan cara menghapus seluruh spreadsheet menggunakan kode VBA. Ini juga menunjukkan kepada Anda cara yang berbeda","og_url":"https:\/\/exceladvisor.org\/id\/lembar-bening\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-06T06:19:27+00:00","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\/lembar-bening\/","url":"https:\/\/exceladvisor.org\/id\/lembar-bening\/","name":"Bagaimana cara MENGHAPUS seluruh lembar menggunakan VBA di Excel?","isPartOf":{"@id":"https:\/\/exceladvisor.org\/id\/#website"},"datePublished":"2023-11-13T20:26:28+00:00","dateModified":"2023-12-06T06:19:27+00:00","description":"Tutorial ini menunjukkan cara menghapus seluruh spreadsheet menggunakan kode VBA. Ini juga menunjukkan kepada Anda cara yang berbeda","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/id\/lembar-bening\/#breadcrumb"},"inLanguage":"id","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/id\/lembar-bening\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/exceladvisor.org\/id\/lembar-bening\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Rumah","item":"https:\/\/exceladvisor.org\/id\/"},{"@type":"ListItem","position":2,"name":"Bagaimana cara menghapus seluruh lembar menggunakan vba?"}]},{"@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\/1650","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=1650"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/pages\/1650\/revisions"}],"predecessor-version":[{"id":2854,"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/pages\/1650\/revisions\/2854"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/id\/wp-json\/wp\/v2\/media?parent=1650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}