Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to delete multiple empty columns quickly in Excel?

Sometimes when you import data to Microsoft Excel from some source, such as web page, CSV, text, etc., there may be many empty columns with it. It must be time-consuming to delete each empty column one by one. Therefore, some of us search for easy ways to solve this problem. This article collects some tricky tips to help you delete multiple empty columns quickly.

Delete multiple empty columns with Go To Special Command

Delete multiple empty columns with VBA code

Delete multiple empty columns in selection / active sheet / whole workbook with Kutools for Excel


Delete multiple blank / hidden / visible columns or rows at once:

Kutools for Excel's Delete Hidden (Visible) Rows & Columns utility can help you to delete multiple blank, hidden, visible rows or columns at once.

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


arrow blue right bubble Delete multiple empty columns with Go To Special Command


The Excel’s Go To Special Command can help you quickly select the multiple blank columns, and then you can delete them at once. You can do as the following steps:

1. Select the range containing the blank columns that you want to remove.

2. Click Home > Find & Select > Go To Special, in the Go To Special dialog box, check the Blanks option. See screenshot:

3. And then click OK, all of the blank columns of the selected range are highlighted. See screenshot:

4. Then click Home > Delete > Delete Sheet Columns, the blank rows have been deleted from the selected range. See screenshot:


arrow blue right bubble Delete multiple empty columns with VBA

If you'd like to use VBA macro, things goes much easier. The following VBA code may help you, please do as this:

1. Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following macro in the Module Window.

VBA code:  Delete multiple blank columns in selection:

Sub DeleteEmptyColumns()
'Updateby20140317
Dim rng As Range
Dim InputRng As Range
xTitleId = "KutoolsforExcel"
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

3. Press the F5 key to run this macro. Select the work range you need to the pop out dialog. See screenshot:

4. Click OK, then all empty columns in the selection are removed. See screenshot:


arrow blue right bubble Delete multiple empty columns in selection / active sheet / whole workbook with Kutools for Excel

The Delete Hidden (Visible) Rows & Columns utility of Kutools for Excel can help you quickly remove multiple empty rows or columns at once.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days. 

After installing Kutools for Excel, please do as this:

1. Click Kutools > Delete > Delete Hidden (Visible) Rows & Columns, see screenshot:

doc-delete-blank-columns 5

2. In the Delete Hidden (Visible) Rows & Columns dialog box, specify the scope that you want to apply the operation from Look in drop down list. (If you choose In Selected Range, you must select a range that you want to use first.) And then check Columns under Delete type. And select Blank columns from Detailed type. See screenshot:

doc-delete-blank-columns 6

3. Then click OK. And the blank columns have been deleted from the selected range. See screenshots:

doc-delete-blank-columns7
-1
doc-delete-blank-columns8

To know more about this feature, please visit the Delete Rows & Columns function.

 Download and free trial Kutools for Excel Now!


arrow blue right bubble Demo: Delete multiple empty rows or columns with Kutools for Excel

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Related articles:


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Screen Shot of Excel (with Office Tab installed)

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    sawan · 1 years ago
    Thanks its very helpful page with basic excel option :)
  • To post as a guest, your comment is unpublished.
    shabbir juzar deluxe · 2 years ago
    Hi,
    can anyone guide how i can delete blank cells in a row or column...note whole blank column or rows... only blank cell i need to delete in a column
  • To post as a guest, your comment is unpublished.
    uday · 2 years ago
    Hi, the thing which you are mentioned is so helpfull.

    I want a small help from your side.

    Daily am download the some files and using pivot prepared the reports. It is daily task for me and routine process. How can i do it with out using pivot.

    Ex: If i prepared the reports on yesterday in "A" Excel file.
    Next day in "A" Excel file just i replace the new "B" Excel file data. By this automatically report would be create?

    Is it possible?
  • To post as a guest, your comment is unpublished.
    Nelson · 3 years ago
    Very helpful page. Thank you. :-)
    My challenge is that I have columns with headers, but no data in that column. Only the header is present. How would one go about deleting columns where there is no data, but the header is there? :o
  • To post as a guest, your comment is unpublished.
    KARTHIKEYAN · 5 years ago
    the above details are very helpful for my personal use. Thanks for your guidance.

    M.KARTHIKEYAN :-)