+ Reply to Thread
Results 1 to 5 of 5

Delete one sheet from 2000+ workbooks.

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    NYC, NY
    MS-Off Ver
    Excel 2010
    Posts
    2

    Delete one sheet from 2000+ workbooks.

    I have around 2000 reports that all have a one sheet with the same name I need to be removed per a client’s request.
    a)I was wondering if there is a macro that will allow me delete a specified sheet on all workbooks within a folder.

    (I think the thread I have attached deletes a sheet but I am a bit of a novice and have not been able to get it to work properly.

    http://www.excelforum.com/excel-prog...html?p=2895807)

    b)Then after I process all of the reports remove the macro from all of the workbooks so clients do not think they have a virus.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Delete one sheet from 2000+ workbooks.

    What is the name of the sheet that needs to be deleted?

    The macro will not reside in all the workbooks but in one file alone (an independent macro file) which will open each of the 2000 workbooks and delete the sheet.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    10-09-2012
    Location
    NYC, NY
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Delete one sheet from 2000+ workbooks.

    The sheet is "Release Report"

    Will it open the file then delete, save, and close?

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Delete one sheet from 2000+ workbooks.

    Yeah, i will provide you the code where you can change the filepath as per your system. You can test it on a set of dummy files first.

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Delete one sheet from 2000+ workbooks.

    Try this code - change the part which is highlighted below
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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