+ Reply to Thread
Results 1 to 3 of 3

copy all sheets after shee5 (or specifically named sheet) to a new workbook

  1. #1
    Registered User
    Join Date
    10-21-2017
    Location
    Peterbrorough, England
    MS-Off Ver
    2016 Education
    Posts
    4

    copy all sheets after shee5 (or specifically named sheet) to a new workbook

    Hi All

    I have a workbook in which excel uses data on the first 5 sheets to create multiple sheets with names dependant on that data.
    What I want is to use VBA to copy the newly created sheets (could be between 1 and 30 new sheets) into a new workbook.
    The easiest way to do this, I believe should be to say "all sheets after the sheet named "CONTEXT_PAGE".move (if you know what I mean)

    Is this possible? Can anyone give me an idea of how to do so?

    I can't attach the file as it contains a lot of sensitive data.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: copy all sheets after shee5 (or specifically named sheet) to a new workbook

    What might be easier is to copy the entire workbook, loop through all the sheets in the copy workbook converting everything to values and then delete specific named worksheets. You can't rely on any worksheet being in a specific position in the workbook.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-21-2017
    Location
    Peterbrorough, England
    MS-Off Ver
    2016 Education
    Posts
    4
    Quote Originally Posted by TMS View Post
    What might be easier is to copy the entire workbook, loop through all the sheets in the copy workbook converting everything to values and then delete specific named worksheets. You can't rely on any worksheet being in a specific position in the workbook.
    Good idea, do you have a sample code which would do similar? I’m a bit of a beginner! I can on the other hand rely on the first 5 pages not changing position (all new sheets are created after the first 5 and no additional sheets need to be added to the five data sheets)

+ 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. [SOLVED] To copy rows from one sheet to other sheets based on the first part of the named cell
    By JamesJohnson31 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-30-2014, 12:38 AM
  2. Copy Named Range to new sheet in workbook
    By ker9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2014, 02:25 PM
  3. [SOLVED] Copy named sheets from one workbook to names sheet in other
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-30-2014, 07:42 AM
  4. [SOLVED] Copy Each Sheet to New Workbook bar certain named sheet
    By lewny1983 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-21-2012, 12:43 PM
  5. VBA: Copy All Sheets to the same workbook (except named), and remove formula
    By simonmoore32 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-16-2011, 09:49 AM
  6. [SOLVED] Copy Sheets From Another Workbook Without Named Ranges
    By Dikolis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-16-2009, 05:58 PM
  7. [SOLVED] copy all named ranges in a sheet to seperate sheets
    By Chris Salcedo in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-10-2005, 02:05 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