ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting worksheets (https://www.excelbanter.com/excel-programming/321492-deleting-worksheets.html)

Alan L. Wagoner

Deleting worksheets
 
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



Don Guillett[_4_]

Deleting worksheets
 
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


--
Don Guillett
SalesAid Software

"Alan L. Wagoner" wrote in message
...
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





Tom Ogilvy

Deleting worksheets
 
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

--
Regards,
Tom Ogilvy

"Alan L. Wagoner" wrote in message
...
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





Alan L. Wagoner

Deleting worksheets
 
Many thanks Don and Tom!

"Alan L. Wagoner" wrote in message
...
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





Don Guillett[_4_]

Deleting worksheets
 
glad to help

--
Don Guillett
SalesAid Software

"Alan L. Wagoner" wrote in message
...
Many thanks Don and Tom!

"Alan L. Wagoner" wrote in message
...
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








All times are GMT +1. The time now is 04:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com