View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

For Each sh In ThisWorkbook.Worksheets
If Left(sh.Name,5) = "name-" Then
if ThisWorkbook.Sheets.Count < 0 Then
Application.DisplayAlerts = false
sh.delete
Application.DisplayAlerts = True
End If
End If
Next sh

--
HTH

Bob Phillips

"Newbie80" wrote in
message ...

Hi, I have some sheets that starts with the same substring and I want
all of them to be removed is there a simpel solution to this?

e.g
Thisworkbook.sheets("name-yyyy").delete exact match
The year differs so would like to remove all sheets that starts with:
Thisworkbook.sheets("name-").delete (multi delete if poss)


--
Newbie80
------------------------------------------------------------------------
Newbie80's Profile:

http://www.excelforum.com/member.php...o&userid=25946
View this thread: http://www.excelforum.com/showthread...hreadid=393860