View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dale[_15_] Dale[_15_] is offline
external usenet poster
 
Posts: 9
Default Reference worksheet by partial name ?? wildcard

Excellent...I should have known that...

"Jim Cone" wrote in message
...
This will delete any worksheet that ends with: number, space, Summary...
Dim WS As Excel.Worksheet
For Each WS In Worksheets
If WS.Name Like "*# Summary" Then
WS.Delete
End If
Next
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Dale"

wrote in message
Hello..
I have several pivot tables I've created from code derived from a "master"
2
week work schedule. Each pivot table summarizes the daily job schedules
and
resources. I want to be able to delete the pivot table worksheets
whenever
the schedule is updated in order to recreate each pivot table summary
reflecting the new schedule.

Each pivot table worksheet is named by a date followed by "summary" i.e.
Oct
21 summary. I would like to be able to delete each worksheet having the
word "summary". So far I've been able to do this by using
worksheets(index)
if the worksheet is appended after the master schedule. But if a user
adds
another worksheet in the same manner it could get deleted in error.
I appreciate any help you can provide..thanks.