Solved

Delete Empty Worksheets

Posted on 2011-09-05
2
218 Views
Last Modified: 2012-05-12

Need to delete all worksheets in workbook that have no data.
0
Comment
Question by:mato01
2 Comments
 
LVL 11

Expert Comment

by:Plantwiz
Comment Utility
Highlight the worsheet tab, right click, delete

Or is there more information you are able to provide regarding your initial question?
0
 
LVL 80

Accepted Solution

by:
byundt earned 125 total points
Comment Utility
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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now