Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Deleting Custom Views when Deleting Sheets

I have a routine which deletes worksheets in a workbook. When I delete the
worksheets, I want to ensure that the custom views on those sheets are
deleted as well. Is there a way when deleting a sheet to test to see if it
has a custom view on that sheet? Does the view have a property that
identifies the sheet its on?

If not, is there a way to test to see if a custom view is still relevant? I
know that when I delete sheets, the views stay behind. If you try to
manually select the view an error message is NOT generated. As such its not
obvious that it no longer is relevant. The Show method below would not
generate an error message in VBA if the view it is attempting to show was
missing.

ActiveWorkbook.CustomViews("Condensed Consolidated Summary 1").Show

Thanks

EM
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Deleting Custom Views when Deleting Sheets

CustomViews are not tied to a particular worksheet, as you can see from the
Object browser, as they are a member of Workbook.
Each view represents the appearance of all the WSs when the view is added.

So, even if a WS is deleted, it is still valid for the remaining WSs, albeit
with no visible change.
AFAIK there is no means to tell which WS/Cell/setting will be affected by
any particular CustomView.

NickHK

"ExcelMonkey" wrote in message
...
I have a routine which deletes worksheets in a workbook. When I delete

the
worksheets, I want to ensure that the custom views on those sheets are
deleted as well. Is there a way when deleting a sheet to test to see if

it
has a custom view on that sheet? Does the view have a property that
identifies the sheet its on?

If not, is there a way to test to see if a custom view is still relevant?

I
know that when I delete sheets, the views stay behind. If you try to
manually select the view an error message is NOT generated. As such its

not
obvious that it no longer is relevant. The Show method below would not
generate an error message in VBA if the view it is attempting to show was
missing.

ActiveWorkbook.CustomViews("Condensed Consolidated Summary 1").Show

Thanks

EM



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
Deleting All Custom Cell Styles rwmitchell32 Excel Discussion (Misc queries) 5 July 27th 09 04:43 PM
Deleting cell data without deleting formula Tom Hall Excel Discussion (Misc queries) 4 October 29th 06 04:07 PM
deleting values in a worksheet without deleting the formulas patti Excel Worksheet Functions 1 October 28th 05 09:49 PM
Deleting Hyphens or Dashes from multiple cells without deleting the remaining content rmaloy Excel Programming 5 February 9th 04 01:59 AM
Using BeforeClose for deleting a custom toolbar daithimcc[_5_] Excel Programming 3 February 1st 04 10:57 PM


All times are GMT +1. The time now is 10:13 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"