View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Remove unwanted tabs

I think this will do what you need. Back up your workbook before trying it
out.

Sub DeleteTabs()
On Error Resume Next
Application.DisplayAlerts = False

For Each x In Worksheets
If IsEmpty(x.UsedRange) Then x.Delete
Next x

Application.DisplayAlerts = True

End Sub

"greengrass" wrote:


Can someone please provide me with a procedure to delete unused tabs.

I have a workbook that has 20 tabs containing pricing and material
numbers. When the users fills out information it is usually only on
one tab and I would like a macro function to automatically delete the
other 19 sheets to reduce the size of the file.

Thanks,

GG


--
greengrass
------------------------------------------------------------------------
greengrass's Profile: http://www.excelforum.com/member.php...o&userid=23119
View this thread: http://www.excelforum.com/showthread...hreadid=374981