+ Reply to Thread
Results 1 to 7 of 7

Macro to Delete All Sheets Except One

  1. #1
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Macro to Delete All Sheets Except One

    Hi

    I have a workbook with about 27 sheets can someone help me with part of a script that would select all sheets grab the data from ranges A1:E1 and paste it to another sheet called (data) in order from 1 to 27 then delete all the sheets except the (data) sheet ?

    Thank You

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Are all the sheets laid out the same?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951
    Yes,
    All the sheets are perfect copies of each other except the top line (A1:E1) This line totals all the data per page. I'm just looking to move the top line From all in this case (27) sheets to another sheet called (data) ranges (A3:E3) and delete all the other 27 sheets.

    Thank You ...

  4. #4
    Forum Contributor
    Join Date
    10-08-2006
    Location
    Walnut, CA
    MS-Off Ver
    2003,2010, Office 365
    Posts
    114
    Hi,
    Try this
    Please Login or Register  to view this content.
    Tony

  5. #5
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951
    Thanks Tony,

    I am getting a subscript out of range error. I'm not sure what to do. Here is what I am working with so far.

    Thanks for your help...

    Mike

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    10-08-2006
    Location
    Walnut, CA
    MS-Off Ver
    2003,2010, Office 365
    Posts
    114
    Hi,
    You're missing the following statement on my original posting.
    Please Login or Register  to view this content.
    Tony

  7. #7
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951
    Tony...Thank You Very Much,

    Figues I missed a line of code. Haste makes waste

    I was able to modify your script and correct the issue while I was waiting for your reply. Everything is working like a charm However thank you very much for your Work.

    Many Many Thanks.

    Here is my Final Code if anyone would use it for anything .

    Please Login or Register  to view this content.

+ 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