![]() |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 04:19 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com