Forum Discussion

Haytham Amairah's avatar
Haytham Amairah
Silver Contributor
May 20, 2018

Re: Delete an EXCEL worksheet

Hi Jerry,

 

What the type of the closing?

Is it a normal closing or crashing?

 

Have you any macro stored in the workbook?

I don't think that the worksheet is corrupted, but maybe there is a macro associated with the event of activating this worksheet, so it will close the workbook when you select the worksheet.

 

3 Replies

  • jerry wheatley's avatar
    jerry wheatley
    Copper Contributor

    Thank you for your response to my message.  While I do not use macros, I do utilize a number of EXCEL functions (sumifs, vlookup, countif, etc.). I also ran several virus and malware detection scans, none were found. When the workbook closes it is immediate, I would classify it as crashing. Strange, there are probably 50 worksheets in this workbook. You can select any other tab and the workbook functions normally. Open this one and it will immediately crash each time; which is why I was determined to simply delete the sheet and then recreate it; but I cannot delete it, the crash is immediate and does not allow me enough time to delete the sheet normally. I was hoping there was a way to delete a sheet without opening it.

     

    Thank you again for considering ways you are aware of to resolving this problem.

     

    jerry wheatley

    • Haytham Amairah's avatar
      Haytham Amairah
      Silver Contributor

      Ok, please try this solution:

      • Open the workbook
      • Press Alt+F11 to open the Visual Basic for Applications editor
      • Put this command in the Immediate window: Thisworkbook.Worksheets("SheetName").Delete 
      • If the Immediate window isn't visible, press Ctrl+G to show it.
      • Please replace the SheetName in the command with the real sheet name.
      • Press Enter

       

      • jerry wheatley's avatar
        jerry wheatley
        Copper Contributor

        Thank you so very much help me resolve my issue. Although I'm comfortable using the functionality EXCEL provides; I'm afraid I'm not tech savvy enough to understand how to correct an issue like the one I presented to you. Thanks again for your assistance.

         

        jpw

Resources