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


How to quickly check if a sheet is empty in Excel?

If there are some empty sheets in a huge workbook, how can you quickly check if a sheet is empty in the workbook, then delete them? In Excel, there is a built-in function to determine if a sheet is empty or not, but here, I introduce a VBA code to you to check if a sheet is empty.

Check if a sheet is empty with VBA

Check if a sheet is empty with VBA

To check if a sheet is empty, you can use below macro code to quickly determine if a sheet is blank.

1. Enable a sheet you want to check if is empty, press Alt + F11 key to open Microsoft Visual Basic for Applications window, and click Insert > Module to create a new Module.
doc check if sheet empty 1

2. In the blank script, paste below macro code to it. See screenshot:

VBA: Check if a sheet is empty

Sub CheckSheetEmpty()
    If WorksheetFunction.CountA(ActiveSheet.UsedRange) = 0 And ActiveSheet.Shapes.Count = 0 Then
        MsgBox "Sheet is empty", vbInformation, "KuTools For Excel"
        MsgBox "Sheet is not empty", vbInformation, "KuTools For Excel"
    End If
End Sub

doc check if sheet empty 2

3. Save the code and press F5 key to run the code, and a dialog will pop to remind you that the sheet is empty or not.

doc check if sheet empty 3 doc check if sheet empty 4

Create List of Sheet Names

The Kutools for Excel's Create List of Sheet Names utility can quickly create a new sheet with list of clickable sheet names  as below screenshot shown.
doc list sheet name

Recommended Productivity Tools for Excel

Kutools for Excel Helps You Always Finish Work Ahead of Time, and Stand Out From Crowd

  • More than 300 powerful advanced features, designed for 1500 work scenarios, increasing productivity by 70%, give you more time to take care of family and enjoy life.
  • No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
  • Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds, 
  • Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 highly effective people and 300+ world-renowned companies' choice.
  • 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

Brings Tabbed Browsing and Editing to Microsoft Office, Far More Powerful Than The Browser's Tabs

  • Office Tab is designed for Word, Excel, PowerPoint and Other Office Applications: Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
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.

Be the first to comment.