+ Reply to Thread
Results 1 to 12 of 12

Remove Sheet Greyed Out in VBA Editor

  1. #1
    Registered User
    Join Date
    12-02-2021
    Location
    PA, USA
    MS-Off Ver
    Office 365
    Posts
    20

    Remove Sheet Greyed Out in VBA Editor

    I have a spreadsheet where I am trying to remove an object in the VBA editor but Remove Sheet is greyed out. After a little bit of frustration and searching I got the bright idea to create a brand new spreadsheet from scratch and try to remove a sheet again. Same results, Remove Sheet is greyed out.

    Screenshot 2023-02-16 155359.png

    What am I doing wrong?
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Remove Sheet Greyed Out in VBA Editor

    You can't remove sheet modules from the VBA environment. You have to remove the actual worksheet.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    12-02-2021
    Location
    PA, USA
    MS-Off Ver
    Office 365
    Posts
    20

    Re: Remove Sheet Greyed Out in VBA Editor

    Thank you. The reason why I went down this path is because I have a workbook where the best I can explain, somehow Excel converted one of the worksheets I deleted to a workbook instance(?).
    For the life of me I can't figure out how to remove it. Any ideas?

    Screenshot 2023-02-16 170245.png
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Remove Sheet Greyed Out in VBA Editor

    Hello. It has happened to me very few times...

    However, given the real possibility of internal workbook corruption, it is preferable to copy the useful information from that workbook to a new one:

    - Copy each sheet.
    - Copy each VBA module
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

  5. #5
    Registered User
    Join Date
    12-02-2021
    Location
    PA, USA
    MS-Off Ver
    Office 365
    Posts
    20

    Re: Remove Sheet Greyed Out in VBA Editor

    I ran in to a problem where Excel won’t let me copy sheets with tables in them. Unfortunately that’s a high number of worksheets. Is there a trick to copying them?

  6. #6
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Remove Sheet Greyed Out in VBA Editor

    Of course Excel allows you to copy sheets that contain tables... but you have to copy those sheets individually: one by one.

  7. #7
    Registered User
    Join Date
    12-02-2021
    Location
    PA, USA
    MS-Off Ver
    Office 365
    Posts
    20

    Lightbulb Re: Remove Sheet Greyed Out in VBA Editor

    {Facepalm} You know they say you learn something new every day?

  8. #8
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Remove Sheet Greyed Out in VBA Editor

    Hi there,

    Here's a suggestion that won't take to long to try, and just might solve the problem: move the used rows & columns of your "problem" worksheet to a new worksheet and then delete the "problem" worksheet.

    Worth a try? Hope it helps.

    Regards,

    Greg M

  9. #9
    Registered User
    Join Date
    12-02-2021
    Location
    PA, USA
    MS-Off Ver
    Office 365
    Posts
    20

    Re: Remove Sheet Greyed Out in VBA Editor

    Quote Originally Posted by Greg M View Post
    Hi there,

    Here's a suggestion that won't take to long to try, and just might solve the problem: move the used rows & columns of your "problem" worksheet to a new worksheet and then delete the "problem" worksheet.

    Worth a try? Hope it helps.

    Regards,

    Greg M
    The problem wasn’t with my first example, the problem was in my second file. What was once a worksheet somehow became a workbook object in the file when I deleted it. It would no longer open as a worksheet and it somehow took the properties of ThisWorkbook. So if I changed the name of it, it would change the name of ThisWorkbook! It was very odd. Never saw that before.

  10. #10
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Remove Sheet Greyed Out in VBA Editor

    Quote Originally Posted by TheRazor View Post
    {Facepalm} You know they say you learn something new every day?
    And what they say is especially true in the world of technology.

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Remove Sheet Greyed Out in VBA Editor

    Quote Originally Posted by beyond Excel View Post
    real possibility of internal workbook corruption, it is preferable to copy the useful information from that workbook to a new one:
    I agree that this appears to be a corruption. When examining the xml, there is no worksheet there.

  12. #12
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Remove Sheet Greyed Out in VBA Editor

    Hi again,

    Thanks for that interesting information.

    The following code might be useful if you wish to move all of your worksheets to a new workbook:

    Please Login or Register  to view this content.

    Hope this helps.

    Regards,

    Greg M

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can’t Remove Projects in Editor
    By oskar44 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2015, 10:37 AM
  2. Right click on sheet option are greyed out
    By Ranbir in forum Excel General
    Replies: 5
    Last Post: 12-28-2014, 03:55 PM
  3. Greyed out buttons in Excel 2011's Visual Basic Editor on Mac
    By tangerine357 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-06-2013, 01:56 PM
  4. greyed out toolbars and dropdown menu choices after using VB Editor
    By PSMadison in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2013, 05:11 PM
  5. [SOLVED] Excel 2007 : Delete sheet and Unhide greyed out
    By abhinavn in forum Excel General
    Replies: 2
    Last Post: 04-12-2012, 03:49 PM
  6. Replies: 5
    Last Post: 01-25-2012, 12:31 PM
  7. Excel 2007 : Can't copy or move sheet - greyed out
    By sweep in forum Excel General
    Replies: 2
    Last Post: 10-07-2010, 10:49 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1