filmov
tv
3 Right Ways to Delete Blank Columns in Excel
Показать описание
In this video, I will show you 3 different methods you can use to quickly delete blank columns in Excel.
I am also going to cover one additional method that works well but needs to be used cautiously, as it can lead to issues
00:00 Intro
00:25 Delete Blank Columns using SORT method
03:12 Delete Blank Columns using Find & Replace method
05:55 Delete Blank Columns using VBA
10:07 Delete Blank Columns using Go To Special (NOT recommended)
------------------------------------------------------------------------------------------------
Below is the VBA code I used in the video:
Sub DeleteBlankColumns()
Dim EntireColumn As Range
On Error Resume Next
Application.ScreenUpdating = True
For i = Selection.Columns.Count To 1 Step -1
Set EntireColumn = Selection.Cells(1, i).EntireColumn
If Application.WorksheetFunction.CountA(EntireColumn) = 0 Then
EntireColumn.Delete
End If
Next
Application.ScreenUpdating = True
End Sub
------------------------------------------------------------------------------------------------
#Excel #ExcelTips #ExcelTutorial
I am also going to cover one additional method that works well but needs to be used cautiously, as it can lead to issues
00:00 Intro
00:25 Delete Blank Columns using SORT method
03:12 Delete Blank Columns using Find & Replace method
05:55 Delete Blank Columns using VBA
10:07 Delete Blank Columns using Go To Special (NOT recommended)
------------------------------------------------------------------------------------------------
Below is the VBA code I used in the video:
Sub DeleteBlankColumns()
Dim EntireColumn As Range
On Error Resume Next
Application.ScreenUpdating = True
For i = Selection.Columns.Count To 1 Step -1
Set EntireColumn = Selection.Cells(1, i).EntireColumn
If Application.WorksheetFunction.CountA(EntireColumn) = 0 Then
EntireColumn.Delete
End If
Next
Application.ScreenUpdating = True
End Sub
------------------------------------------------------------------------------------------------
#Excel #ExcelTips #ExcelTutorial
Комментарии