+ Reply to Thread
Results 1 to 4 of 4

Macro to delete first working sheet in multiple files

  1. #1
    Registered User
    Join Date
    05-05-2014
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel for Mac 2011
    Posts
    2

    Macro to delete first working sheet in multiple files

    Hey everyone,

    I have 300+ files, each containing 2 sheets. The names of the sheets are same in all files – 1st one is "Search strategy", the 2nd one is "Results".
    I would like to delete the first sheet in all the files at once. How could I do that?

    Thanks in advance,
    Timofey

  2. #2
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro to delete first working sheet in multiple files

    Hi.. Try this..

    Assuming your files are all in the folder (or subfolder) shown...

    Change the filepath (in red font) to suit..

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-05-2014
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel for Mac 2011
    Posts
    2

    Re: Macro to delete first working sheet in multiple files

    Thanks.
    This doesn't work however :/. I changed the filepath to the actual "*/Users/Timofey/Documents/Stata1/BvD Main Data/*". When I try to run it, Excel says "Run time error 429" ActiveX component can't create object. When I push debug, the whole line with the directory gets highlighted in yellow. Have an idea what I'm doing wrong?
    Last edited by Kaapoff; 05-06-2014 at 05:30 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro to delete first working sheet in multiple files

    Hi.. sory.. I didn't notice the Excel for Mac..

    I am thinking it probably a reference issue or an issue with Mac and CreateObject... it will work fine on a PC..

+ 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. Macro to delimit and compile multiple files to one sheet:
    By llunde3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-15-2013, 10:34 AM
  2. Replies: 2
    Last Post: 05-06-2013, 06:41 PM
  3. [SOLVED] Daniello1 - How to write a macro that would delete a sheet across multiple workbooks
    By tigeravatar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2012, 05:31 PM
  4. Macro involving multiple sheet and files
    By dguenther in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2011, 08:41 AM
  5. Macro for updating a sheet in multiple files
    By jijy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-26-2006, 01:21 PM

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