Deprecated: Creation of dynamic property CF\WordPress\DataStore::$logger is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php on line 23

Deprecated: Creation of dynamic property CF\WordPress\Proxy::$pluginAPI is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/Proxy.php on line 31

Deprecated: file_get_contents(): Passing null to parameter #2 ($use_include_path) of type bool is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/codelights-shortcodes-and-widgets/codelights.php on line 20

Warning: session_start(): Session cannot be started after headers have already been sent in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/automatic-video-posts/vendor/ternstyle/wordpress/src/class/wordpress.php on line 53

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Deprecated: Creation of dynamic property ternplugin\youtube_video::$post is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/automatic-video-posts/vendor/ternstyle/plugin/src/class/youtube_video.php on line 64

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":1700,"date":"2019-09-02T05:19:29","date_gmt":"2019-09-02T12:19:29","guid":{"rendered":"https:\/\/bonbonsguide.com\/wp\/?p=1700"},"modified":"2023-05-04T15:08:58","modified_gmt":"2023-05-04T22:08:58","slug":"delete-every-other-row-or-column-in-excel-using-formula-or-vba","status":"publish","type":"post","link":"https:\/\/bonbonsguide.com\/wp\/blog\/2019\/09\/delete-every-other-row-or-column-in-excel-using-formula-or-vba\/","title":{"rendered":"Delete Every Other Row or Column in Excel (using Formula or VBA)"},"content":{"rendered":"\n

Today we are going to explore various ways to delete every other row or delete every other column in Excel. VBA macro code is included to help you on your way if that is the path you choose.<\/p>\n\n\n\n

Additionally, we will also cover how to delete every third\/fourth\/fifth row or column in Excel.<\/p>\n\n\n\n

To delete alternate rows, you can use a helper column and use a formula that helps you identify alternate rows. This could be done by using the ISEVEN function that checks each row number and returns TRUE if the row is even and false if it isn’t.<\/p>\n\n\n\n

Once you have this, you can easily filter the rows with FALSE in the helper columns and delete these.<\/p>\n\n\n\n

In case you want to delete every third row, you need to use the MOD function to identify every third row. Once you have it, you can easily filter and delete every third row or every fourth row.<\/p>\n\n\n\n

I also cover a method to use a simple VBA code to delete alternate rows in Excel.<\/p>\n\n\n\n

Below is that VBA CODE TO DELETE ALTERNATE ROWS:<\/p>\n\n\n\n

Sub Delete_Every_Other_Row()\nDim Rng As Range\nSet Rng = Application.InputBox(\"Select the Range (Excluding headers)\", \"Range Selection\", Type:=8)\nFor i = Rng.Rows.Count To 1 Step -2\nIf i Mod 2 = 0 Then\nRng.Rows(i).Delete\nEnd If\nNext i\nEnd Sub<\/code><\/pre>\n\n\n\n

When it comes to deleting alternate columns, you cannot filter these. You can instead sort and bring all those columns together that you want to delete.<\/p>\n\n\n\n

I cover a simple method that uses the MOD function to identify alternate columns and then sort these from left-to-right to bring these together. Once you have these in one place, you can select and delete these.<\/p>\n\n\n\n

And there is also a VBA code that you can use to delete alternate columns.<\/p>\n\n\n\n

Below is the VBA CODE TO DELETE ALTERNATE COLUMNS<\/p>\n\n\n\n

Sub Delete_Every_Other_Column()\nDim Rng As Range\nSet Rng = Application.InputBox(\"Select the Range (Excluding headers)\", \"Range Selection\", Type:=8)\nFor i = Rng.Columns.Count To 1 Step -2\nIf i Mod 2 = 0 Then\nRng.Columns(i).Delete\nEnd If\nNext i\nEnd Sub<\/code><\/pre>\n\n\n\n

<\/p>\n\n\n\n

Subscribe to this YouTube channel to get updates on Excel Tips and Excel Tutorials videos – https:\/\/www.youtube.com\/c\/trumpexcel<\/p>\n\n\n\n

<\/p>\n\n\n\n

You can find a lot of useful Excel resources on the following site: https:\/\/trumpexcel.com\/<\/p>\n\n\n\n

#Excel #ExcelTips #ExcelTutorial<\/p>\n\n\n\n