The article will provide you some quick tricks to delete empty columns with header in Excel. While working on an Excel worksheet, you may need to deal with many things. One of them may be deleting empty columns with headers. I have added four suitable methods here. You will find the necessary images attached with every step. Hopefully, you will find the processes interesting.
Download Practice Workbook
Please download the workbook to practice yourself.
4 Effective Ways to Delete Empty Columns With Header in Excel
Here is the dataset I am going to use here. The dataset has three columns and one empty column. The columns are B, C, D, and E called ID, Products, Price, and Delivery Date. Here, the column named Price is an empty column. I need to remove this column from the data table. I will show four methods here to Excel delete columns with header. Follow the procedures step by step.
1. Deleting Empty Columns With Header by Excel Editing Tools
This is the first method of this article. I will show you here the process of Excel delete empty columns with header. Here, in the dataset, you will find the Price column is empty. Follow the procedure step by step. Hopefully, this will increase your Excel skill.
- Select the D column first by clicking where the arrow sign is placed.
- Then, right–click on the column D.
- Consequently, a pop-up window will be seen.
- After that, select the Delete option.
- Hence this command will delete the entire D column.
This is how you can delete empty columns with header in excel. This method is the most common and easiest way of deleting columns.
Read More: How to Delete Columns Based on Header Using VBA in Excel
2. Implementing Find & Search Option
This is the second method of this article. I will use the search and find option here to delete empty columns with header in Excel. This is also a short process. You can see the Price column is empty here. I will delete this column. I hope you will enjoy the whole process. Follow the procedures step by step.
- First, go to your Home tab in your Toolbar.
- Then select the editing option.
- After that, select the Find and Select
- Meanwhile, a window will pop up. You will find the Go to special option there. Click on it.
- Then, in the Go to special option, select the Blanks option. The blank columns of the data table will be selected.
- Right click on the selected cell.
- Then, select the Delete option.
- Meanwhile another window will pop-up. Select the Entire Column option from there.
- As a result, by this command, excel will delete the entire D column.
This is how you can delete empty columns from the data table manually.
Read More: Can’t Delete Blank Columns in Excel (3 Problems & Solutions)
- How to Delete Multiple Columns by Number Using VBA in Excel (4 Ways)
- Clear Contents in Excel Without Deleting Formulas (3 Ways)
- VBA to Delete Column in Excel (9 Criteria)
- How to Delete Multiple Columns in Excel
- Delete Unused Columns in Excel(Easiest 5 Methods)
3. Using Keyboard Shortcut
This is the third method of this article. However, I will use a keyboard shortcut here to delete the empty cell with header in Excel. Follow the following steps.
- First, select the whole D column as it has the empty cells.
- Then press the Ctrl and – buttons one after another.
- As a result, you will see the whole column D entirely deleted and the column E replaces the position.
This is how you can delete empty column with header by using keyboard shortcut.
Read More: How to Delete Extra Columns in Excel (7 Methods)
4. Applying Excel VBA to Delete Empty Columns with Header
This is the fourth method of this article. You can delete a empty column by inserting a VBA code. However, this is a smart process. This method can increase your Excel skill hopefully. Follow the following steps to be familiar with the procedures. You can also see the images attached with the steps for better understanding.
- First, press the Alt+F11 to open the Microsoft Visual basic for Applications
- Open a new module and write down the following code.
Sub MacroToDeleteEmptyColumns() Dim sS_xEnd As Long Dim sS_K As Long Dim sS_xD As Boolean On Error Resume Next sS_xEnd = Cells.Find("*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column If sS_xEnd = 0 Then MsgBox "No data is found on """ & ActiveSheet.Name & """ .", vbExclamation, "Deleting columns with headers" Exit Sub End If Application.ScreenUpdating = False For sS_K = sS_xEnd To 1 Step -1 If Application.WorksheetFunction.CountA(Columns(sS_K)) <= 1 Then Columns(sS_K).Delete sS_xD = True End If Next If sS_xD Then MsgBox "Blank and columns with headers are deleted.", vbInformation, _ "Deleting columns with headers" Else MsgBox "There is no Columns to delete.", _ vbExclamation, "" End If Application.ScreenUpdating = True End Sub
Here, we declared some variables in the VBA code to identify the columns with empty cells and used the If Statement to apply some condition to detect those empty columns.
- Then, after running the code, you will find the following result.
This is how you can use a VBA code to delete empty columns with header.
Read More: VBA Macro to Delete Columns Based on Criteria in Excel (8 Examples)
What to Do If Deleting Empty Columns Does Not Function in Excel
Sometimes deleting empty columns does not work as the column is not empty actually. May be the column looks like empty. Because sometimes, some characters cannot be visible in Excel cells. To detect the culprit cell, you need to follow the procedures given below.
- Select the first cell of the column first.
- Then, press Ctrl and the Down arrow button simultaneously.
- If you see this command does not select all the empty cells below the first one, you will know that there is one cell which has invisible data and it’s blocking the command to select other empty cells. Here, the D6 cell is not empty as the cells below it cannot be selected.
This is how you will detect the empty-looking cell but not empty.
Read More: [Solved!] Can’t Delete Extra Columns in Excel (3 Solutions)
Things to Remember
- You should bear in mind that every empty looking columns must be empty for deleting the cells.
In this article, I have tried to explain the procedures of Excel delete empty columns with header. I hope, you have learned something new from this article. Now, extend your skill by following the steps of these methods. Additionally, you will find such interesting blogs on our website Exceldemy.com. Moreover, I hope you have enjoyed the whole tutorial. However, if you have any queries, feel free to ask me in the comment section. Don’t forget to give us your feedback.
- How to Delete Hidden Columns in Excel (2 Simple Methods)
- Delete Multiple Columns in Excel with Condition
- How to Delete Columns in Excel That Go on Forever (6 Ways)
- Macro to Delete Columns in Excel (10 Methods)
- How to Delete Infinite Columns in Excel (4 Methods)
- Delete Column and Shift Left Using VBA in Excel (5 Methods)
- How to Delete Columns without Losing Formula in Excel (3 Easy Steps)