Sub DeleteBlankRows_Sort()
' Select the Range you want to remove blank rows and sort rows based on Column A
' Deletes the entire row within the selection if the ENTIRE row contains no data.
Dim i As Long
'turn off calculation and screenupdating to speed up the macro.
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
'We work backwards because we are deleting rows.
For i = Selection.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then
Selection.Rows(i).EntireRow.Delete
End If
Next i
selected_rng = Selection.Address(0, 0)
' you can change the Column you want to sort
Range(selected_rng).Sort Key1:=Range("A1"), Header:=xlYes
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub
VBA Outlook KPI Excel Alt+F11 Dashboards Macros Recording Graphs Automation Developer WaterFall Powerpoint Charts Pivot Tables Forecast Charts