• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

Delete Empty Worksheets


Need to delete all worksheets in workbook that have no data.
0
mato01
Asked:
mato01
1 Solution
 
PlantwizCommented:
Highlight the worsheet tab, right click, delete

Or is there more information you are able to provide regarding your initial question?
0
 
byundtCommented:
Here is a macro to delete the empty worksheets. Install it in a regular module sheet.
Sub DeleteEmptySheets()
Dim ws As Worksheet
Dim rg As Range
On Error Resume Next
Application.DisplayAlerts = False
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
    Set rg = ws.UsedRange
    If (rg.Cells.Count = 1) And (rg.Cells(1, 1) = "") Then ws.Delete
Next
Application.DisplayAlerts = True
End Sub

Open in new window


Brad
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now