Deleting worksheets

  • Thread starter Thread starter Alan L. Wagoner
  • Start date Start date
A

Alan L. Wagoner

Is there a way to delete worksheets using "*"?

I've got a bunch of sheets named IntTable, IntWork, Int...

I would like to be able to delete "Int*". These worksheets are generated
programmatically, so the need to be deleted programmatically as well.

Thanks in advance for the help.

--Alan
 
one way
Sub deleteint()
Application.DisplayAlerts = False
For Each ws In Worksheets
If UCase(Left(ws.Name, 3)) = "INT" Then ws.Delete
Next
Application.DisplayAlerts = True
End Sub
 
Dim sh as Worksheet
for each sh in ActiveWorkbook.Worksheets
if lcase(left(sh.name,3)) = "int" then
Application.DisplayAlerts = False
sh.Delete
Application.DisplayAlerts = True
end if
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top