Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Reference worksheet by partial name ?? wildcard

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Reference worksheet by partial name ?? wildcard

Think I have a passable workaround...I tagged each pivot table with a title
which I reference as an IF condition before deleting the worksheet...but if
anyone has a better approach I'm open to suggestions.


"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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Reference worksheet by partial name ?? wildcard

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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
printing partial worksheet M.GONZALEZ[_2_] Excel Discussion (Misc queries) 3 March 19th 08 01:34 PM
How do I delete a partial worksheet? Crisco Kid Excel Worksheet Functions 1 May 5th 07 05:00 AM
printing partial worksheet p-nut Excel Discussion (Misc queries) 5 March 22nd 07 08:59 AM
Find Worksheet with Wildcard philwongnz[_8_] Excel Programming 3 July 27th 06 04:27 PM
Reference a workbook with only a partial name CC-Khriz Excel Worksheet Functions 0 December 23rd 05 05:40 PM


All times are GMT +1. The time now is 12:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"