+ Reply to Thread
Results 1 to 3 of 3

copy sheets to new workbook when sheet names are similar.

  1. #1
    Forum Contributor
    Join Date
    03-14-2013
    Location
    FL
    MS-Off Ver
    Excel 2013
    Posts
    123

    copy sheets to new workbook when sheet names are similar.

    Hello,

    I have a workbook that has 87 Sheets. The first sheet is ("All Detail"). Everything from that sheets gets splits out by salesman code, then each of that salesman sheets have a second sheet. For example my second sheet is STESU with all the information from STESU. Then there is a second sheet "STESU-Pivot". This is the same format for all the remaining sheets. I need a macro that will run through sheets 2 - 87 and take the salesman coded sheet along with the Pivot sheet associated to the salesman and put both sheets into it's own workbook, preferably with the Workbook named from the salesman code.
    Then it would save all these workbooks into a particular folder. The folder is irrelevant for the macro so for simplicity the code can save it to the C drive.

    There are plenty of macros out there about turning sheets into workbooks but i can't seem to figure out how to make a workbook from two sheets with the names being pulled in dynamically.

    Also in the future there will be more than 87 sheets, so if the macro could be coded to accommodate more sheets in the future that would be great.

    I have attached a sample that has 5 sheets but it gives you the idea of how my workbook looks.

    Thanks for your help!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: copy sheets to new workbook when sheet names are similar.

    Using sheet index is a bit dicey, but if your file always follows the same order of starting with the second sheet, this should work
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-14-2013
    Location
    FL
    MS-Off Ver
    Excel 2013
    Posts
    123

    Re: copy sheets to new workbook when sheet names are similar.

    Genius... Thanks for your help!

+ 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] Dynamically create sheets with similar names and copy cells on row based on matched cus#
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2016, 07:33 AM
  2. [SOLVED] Create Sheets and copy rows to the Sheets if cell contains sheet names
    By CRIMEDOG in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2015, 08:06 AM
  3. Replies: 3
    Last Post: 10-01-2014, 01:49 PM
  4. [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
  5. extrac data from different sheets by sheet name and copy the workbook names
    By ripple in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-31-2013, 11:26 AM
  6. Replies: 1
    Last Post: 01-08-2013, 03:38 AM
  7. [SOLVED] Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook names
    By Arsham24 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2012, 07:42 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