{"id":32868,"date":"2023-11-13T21:41:06","date_gmt":"2023-11-13T20:41:06","guid":{"rendered":"https:\/\/www.myexcelonline.com\/?p=32868"},"modified":"2024-03-22T16:18:30","modified_gmt":"2024-03-22T15:18:30","slug":"delete-entire-row","status":"publish","type":"post","link":"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/delete-entire-row\/","title":{"rendered":"How to Delete Entire Row in Excel using VBA &#8211; 5 Detailed Examples"},"content":{"rendered":"<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-in-Excel-Using-VBA-111.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-33122 size-large\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-in-Excel-Using-VBA-111-1024x576.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"1024\" height=\"576\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-in-Excel-Using-VBA-111-1024x576.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-in-Excel-Using-VBA-111-300x169.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-in-Excel-Using-VBA-111-768x432.png 768w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-in-Excel-Using-VBA-111.png 1280w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>Microsoft Excel is a powerful tool for data management and analysis, and Visual Basic for Applications (<strong><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/free-excel-macros-and-vba-training-2021\/\" target=\"_blank\" rel=\"nofollow noopener\">VBA<\/a><\/strong>) allows users to <strong>automate tasks and enhance the functionality<\/strong> of Excel. One of the <strong>most common tasks is to delete entire row<\/strong> in Excel.<\/p>\n<p>Even though it can easily be done in the workbook itself, you can need the help of <a class=\"wpil_keyword_link\" title=\"VBA\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/101-excel-macros-examples\/\" target=\"_blank\" rel=\"noopener\" data-wpil-keyword-link=\"linked\">VBA<\/a> to<strong> delete rows based on specific criteria<\/strong> in Excel. In this article, we will cover the following<strong> 5 approaches that can be used to delete entire row in Excel using VBA <\/strong>\u2013<\/p>\n<h4>Download the Excel Workbook below to follow along and understand How to Delete Entire Row in Excel using VBA \u2013\u00a0<a class=\"IRPP_minimalist icon-download\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-in-Excel-using-VBA.xlsm\" target=\"_blank\" rel=\"nofollow noopener\"><span class=\"ctaText px-3 text-capitalize\"><strong>download excel workbook<\/strong><\/span><span class=\"postTitle px-3\">Delete-Entire-Row-in-Excel-using-VBA.xlsm<\/span><\/a><\/h4>\n<p>&nbsp;<\/p>\n<h3><strong><span id=\"1\" style=\"color: #ff0000;\">Method 1 \u2013 Delete Entire Row<\/span><\/strong><\/h3>\n<p>Using VBA, you can manually edit the code and mention the row number that you want to delete within the VBA Code. Suppose you want to delete the 1st row of the worksheet.<\/p>\n<p>Follow the steps below to learn how to delete the entire first row of the active sheet \u2013<\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 1:<\/span><\/strong>\u00a0Open the Workbook and go to\u00a0<strong>Developer &gt; Visual Basic<\/strong>\u00a0to open the VBA editor.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-3.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32871\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-3.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"1306\" height=\"160\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-3.png 1306w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-3-300x37.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-3-1024x125.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-3-768x94.png 768w\" sizes=\"(max-width: 1306px) 100vw, 1306px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 2: <\/span><\/strong>Click on <strong>Insert &gt; Module<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-4.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32872\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-4.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"429\" height=\"399\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-4.png 429w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-4-300x279.png 300w\" sizes=\"(max-width: 429px) 100vw, 429px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 3:<\/span> <\/strong>Write the following <strong>code<\/strong> \u2013<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Sub RemoveFirstRow()\r\nRows(1).EntireRow.Delete\r\nEnd Sub<\/pre>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-5.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32873\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-5.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"1165\" height=\"392\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-5.png 1165w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-5-300x101.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-5-1024x345.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-5-768x258.png 768w\" sizes=\"(max-width: 1165px) 100vw, 1165px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 4:<\/span> <\/strong>Close the VBA Editor and run the macro by pressing<strong> Alt + F8<\/strong>, selecting <strong>RemoveFirstRow<\/strong>, and clicking <strong>Run<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-1.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32869\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-1.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"1189\" height=\"535\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-1.png 1189w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-1-300x135.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-1-1024x461.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-1-768x346.png 768w\" sizes=\"(max-width: 1189px) 100vw, 1189px\" \/><\/a><\/p>\n<p>The 1st row will be deleted.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-2.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32870\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-2.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"344\" height=\"520\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-2.png 344w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-2-198x300.png 198w\" sizes=\"(max-width: 344px) 100vw, 344px\" \/><\/a><\/p>\n<p>As you can see, the <strong>number inside the brackets (1 in this case) specifies the row to be deleted<\/strong> in Excel. For instance, if you intend to<strong> delete the 5th row, you can modify the code<\/strong> as follows &#8211;<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Sub RemoveFirstRow()\r\nRows(5).EntireRow.Delete\r\nEnd Sub<\/pre>\n<p>&nbsp;<\/p>\n<h3><strong><span id=\"2\" style=\"color: #ff0000;\">Method 2 \u2013 Delete Selected Rows<\/span><\/strong><\/h3>\n<p>If you want to<strong> delete selected rows in Excel<\/strong> using VBA, you can use the following code.<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Sub DeleteSelectedRows()\r\nOn Error Resume Next\r\nSelection.EntireRow.Delete\r\nOn Error GoTo 0\r\nEnd Sub<\/pre>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-6.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32874\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-6.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"987\" height=\"432\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-6.png 987w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-6-300x131.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-6-768x336.png 768w\" sizes=\"(max-width: 987px) 100vw, 987px\" \/><\/a><\/p>\n<p>You need to<strong> select the rows that you want to delete and then simply run this macro<\/strong> to get the results.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-7.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32876\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-7.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"1278\" height=\"554\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-7.png 1278w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-7-300x130.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-7-1024x444.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-7-768x333.png 768w\" sizes=\"(max-width: 1278px) 100vw, 1278px\" \/><\/a><\/p>\n<p>The selected rows will be deleted.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-8.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32877\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-8.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"390\" height=\"350\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-8.png 390w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-8-300x269.png 300w\" sizes=\"(max-width: 390px) 100vw, 390px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3><strong><span id=\"3\" style=\"color: #ff0000;\">Method 3 \u2013 Delete Alternate Rows<\/span><\/strong><\/h3>\n<p>If you want to <strong>delete alternate rows<\/strong> in Excel using VBA, you can modify the code to achieve this. The following VBA code will<strong> delete every other row, starting from the first row<\/strong> &#8211;<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Sub DeleteAlternateRows()\r\nDim i As Long\r\nFor i = ActiveSheet.UsedRange.Rows.Count To 1 Step -2\r\nActiveSheet.Rows(i).Delete\r\nNext i\r\nEnd Sub\r\n<\/pre>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-9.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32878\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-9.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"1307\" height=\"667\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-9.png 1307w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-9-300x153.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-9-1024x523.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-9-768x392.png 768w\" sizes=\"(max-width: 1307px) 100vw, 1307px\" \/><\/a><\/p>\n<p>After running this macro, the alternate rows will be removed.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-10.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32879\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-10.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"352\" height=\"326\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-10.png 352w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-10-300x278.png 300w\" sizes=\"(max-width: 352px) 100vw, 352px\" \/><\/a><\/p>\n<p>Explore additional methods on how to delete alternate cells in Excel by <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/delete-every-other-row\/\" target=\"_blank\" rel=\"nofollow noopener\"><strong>clicking here<\/strong><\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong><span id=\"4\" style=\"color: #ff0000;\">Method 4 \u2013 Delete Blank Rows<\/span><\/strong><\/h3>\n<p>If you want to delete blank rows in Excel using VBA, use the code provided below &#8211;<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Sub DeleteBlankRows()\r\nDim ws As Worksheet\r\nDim rng As Range\r\nDim row As Range\r\nSet ws = ActiveSheet\r\nSet rng = ws.UsedRange\r\nFor Each row In rng.Rows\r\nIf Application.CountA(row) = 0 Then\r\nrow.Delete\r\nEnd If\r\nNext row\r\nEnd Sub<\/pre>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-11.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32880\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-11.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"1041\" height=\"606\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-11.png 1041w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-11-300x175.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-11-1024x596.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-11-768x447.png 768w\" sizes=\"(max-width: 1041px) 100vw, 1041px\" \/><\/a><\/p>\n<p>This VBA macro will iterate through each row in a specified range <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/delete-spaces-in-excel\/\" target=\"_blank\" rel=\"noopener\">and delete<\/a><strong> any rows where all cells in that row are empty<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-12.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32881\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-12.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"301\" height=\"436\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-12.png 301w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-12-207x300.png 207w\" sizes=\"(max-width: 301px) 100vw, 301px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/delete-blank-cells-in-excel\/\" target=\"_blank\" rel=\"nofollow noopener\"><strong>Click here<\/strong><\/a> to discover more methods on how to delete blank cells in Excel.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong><span id=\"5\" style=\"color: #ff0000;\">Method 5 \u2013 Delete Rows with Specified Word<\/span><\/strong><\/h3>\n<p>If you want to <strong>delete rows in Excel that contain a specific word (e.g., &#8220;1001&#8221;)<\/strong>, you can use the following VBA code. This code <strong>searches for the specified word in a particular column (e.g., column A) and deletes the entire row<\/strong> if the word is found &#8211;<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Sub DeleteRowsWithSpecificWord()\r\nDim ws As Worksheet\r\nDim lastRow As Long\r\nDim i As Long\r\nSet ws = ActiveSheet\r\nlastRow = ws.Cells(ws.Rows.Count, &amp;amp;amp;amp;amp;amp;quot;A&amp;amp;amp;amp;amp;amp;quot;).End(xlUp).Row\r\nFor i = lastRow To 1 Step -1\r\nIf InStr(1, ws.Cells(i, 1).Value, &amp;amp;amp;amp;amp;amp;quot;1001&amp;amp;amp;amp;amp;amp;quot;, vbTextCompare) &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; 0 Then\r\nws.Rows(i).Delete\r\nEnd If\r\nNext i\r\nEnd Sub<\/pre>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-13.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32882\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-13.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"983\" height=\"660\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-13.png 983w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-13-300x201.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-13-768x516.png 768w\" sizes=\"(max-width: 983px) 100vw, 983px\" \/><\/a><\/p>\n<p>All the rows that contain 1001 in column A will be deleted.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-14.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-32883\" title=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-14.png\" alt=\"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples\" width=\"384\" height=\"483\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-14.png 384w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/Delete-Entire-Row-14-239x300.png 239w\" sizes=\"(max-width: 384px) 100vw, 384px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3><strong><span style=\"color: #ff0000;\">Conclusion<\/span><\/strong><\/h3>\n<p>Using VBA code in Excel provides a powerful way to automate tasks and streamline data manipulation. This article has outlined five distinct methods for deleting entire rows in <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/vba-replace-function\/\" target=\"_blank\" rel=\"noopener\">Excel using VBA<\/a>, catering to various scenarios, from deleting specific rows to handling alternates, blanks, and those containing specified words.<\/p>\n<p>Be cautious when using these codes, as it will delete entire row in Excel, and the action cannot be undone. It&#8217;s advisable to back up your data or test the code on a small dataset before applying it to important information.<\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/office\/vba\/library-reference\/concepts\/getting-started-with-vba-in-office\" target=\"_blank\" rel=\"nofollow noopener\"><strong>Click here<\/strong><\/a> to learn more about VBA in Excel.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft Excel is a powerful tool for data management and analysis, and Visual Basic for Applications (VBA) allows users to automate tasks and enhance the functionality of Excel. One of the most common tasks is to delete entire row in Excel. Even though it can easily be done in the workbook itself, you can need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":33122,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cos_headline_score":0,"cos_seo_score":0,"cos_headline_text":"How to Delete Entire Row in Excel using VBA - 5 Detailed Examples","cos_headline_has_been_analyzed":false,"cos_last_analyzed_headline":[],"om_disable_all_campaigns":false},"categories":[647,639,56],"tags":[1443,1444,1445],"acf":[],"_links":{"self":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/32868"}],"collection":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/comments?post=32868"}],"version-history":[{"count":0,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/32868\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media\/33122"}],"wp:attachment":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media?parent=32868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/categories?post=32868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/tags?post=32868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}