- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Delete Multiple Empty Columns Quickly in Excel
Microsoft Excel is a strong data management and analysis programme with a plethora of capabilities. It's fairly uncommon to stumble across empty columns while working with huge spreadsheets, which clutter your data and make it tough to explore and work properly. Delete each empty column manually can be time−consuming and tiresome, especially when dealing with several columns.
Fortunately, Excel includes a variety of strategies for quickly deleting many empty columns, saving you considerable time and effort. We will walk you through the process of discovering and eliminating many empty columns in Excel in this article.
Deleting Multiple Empty Columns Quickly in Excel
Here we will first create a VBA module, then run it to complete the task. So let us see a simple example to demonstrate how you can delete multiple empty columns quickly in Excel.
Consider an Excel sheet where you have data in table format with some blank columns, as shown in the following screenshot.
First, use Alt + F11 to open the VBA application.
Then click on Insert, select Module, and copy the below code into the text box.
Insert > Module > Copy.
Sub DeleteEmptyColumns() Dim rng As Range Dim InputRng As Range xTitleId = "Delete Empty Columns" Set InputRng = Application.Selection Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8) Application.ScreenUpdating = False For i = InputRng.Columns.Count To 1 Step -1 Set rng = InputRng.Cells(1, i).EntireColumn If Application.WorksheetFunction.CountA(rng) = 0 Then rng.Delete End If Next Application.ScreenUpdating = True End Sub
Then, click F5 to run the module, select the range of data, and click OK to delete the multiple empty columns.
F5 > Select cells > Ok.
In this tutorial, we have used a simple example to demonstrate how you can delete multiple empty columns quickly in Excel to highlight a particular set of data.
Kickstart Your Career
Get certified by completing the courseGet Started