Solved

Tab will not hide, can't delete

Posted on 2011-02-24
2
346 Views
Last Modified: 2012-06-27
Hello - we have a old template, developed by someone who is no longer here, that has 16 tabs, one of which does not appear on the spreadsheet, even after doing a Format > Worksheet > Unhide.

The code module for it shows up as a node on the "Excel Objects" in Project Explorer, but even in VBA, ActiveWorkSheet.Delete fails with "Select method of worksheet class failed"
(we wrote a short macro that does a WorkBook.Unprotect, then .Select and .Delete that particular worksheet)

The only way we knew this tab existed was that another macro that is involved in this process blows up when it loops through the workbook to un-hide all the worksheets.  

Anybody seen this before? How do you go about deleting a phantom worksheet?

Thanks
0
Comment
Question by:mlagrange
2 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 34973378
Sheets can be hidden at two levels: hidden and very hidden. Hidden sheets can be unhidden by choosing the menu command Format->Sheet->Unhide, selecting the sheet to unhide from the list, and clicking OK. If that menu command is disabled then either there are no hidden sheets, there are hidden sheets but they are very hidden, or the workbook structure is protected. To unprotect the workbook structure, choose the menu command Tools->Protection->Unprotect Workbook. A password may be needed to complete the unprotection. Once unprotected try to unhide the hidden sheet again.

If the hidden sheet is very hidden, press ALT+F11 to open the VBE, press CTRL+R to open the Project Explorer window, locate and select the sheet to unhide in the list of project objects, press F4 to open the Properties window, locate the Visible property and change it to "-1 - xlSheetVisible". Press ALT+F11 to return to Excel.

Kevin
0
 

Author Comment

by:mlagrange
ID: 34973526
Worked like a charm - Thanks!

(VERY Hidden... sounds like Animal House's  "Double Secret Probation"... sheesh...)

Thanks again
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now