In this article, we have create the a Personal Macro to delete all blank worksheet from active workbook. You can use this for the workbook wherein you have multiple worksheet and you want to delete the blank worksheet only. You can add a button on your excel ribbon to delete all blank worksheet from active workbook.
Delete all blank worksheet
You can add below given code in your personal macro.
Option Explicit Sub Delete_Blank_Worksheets() Application.DisplayAlerts = False Dim sh As Worksheet For Each sh In ActiveWorkbook.Worksheets If Application.WorksheetFunction.CountA(sh.Cells) = 0 Then If ActiveWorkbook.Worksheets.Count > 1 Then sh.Delete End If End If Next MsgBox "Done" End Sub
Visit our YouTube channel to learn step-by-step video tutorials