+ Reply to Thread
Results 1 to 12 of 12

Create new workbook from two existing worksheets from list of names

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Create new workbook from two existing worksheets from list of names

    Hi everyone,

    I have a workbook with multiple worksheets. Worksheet "List) contains a list of worksheet names, all of which are found in the workbook. These worksheet names are listed from B2:B20 and C2:C20.

    What I'm trying to do is build a macro which will run through each row between B2 and C20 and copy the two worksheets in the row to a new workbook. For example

    B2: WS1a
    C2: WS1b
    B3: WS2a
    C3: WS2b

    So the macro would run through rows 2 - 20, find the worksheets listed in columns B and C, and copy them into a new workbook. It would loop through the entire list until 20 workbooks are created, each having the 2 proper worksheets in them. The workbooks would be named based on the B column value of the two worksheets.

    Sort of complicated I know. A bit stumped on this one.

    Any ideas?

    Thanks!!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Create new workbook from two existing worksheets from list of names

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create new workbook from two existing worksheets from list of names

    Hi Alpha,

    Thanks very much, that works great. In Cell B32 I have the exact file location I'd need to get these new workbooks saved. How can I add that into your code?

    Thanks!!

  4. #4
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create new workbook from two existing worksheets from list of names

    Ah, nevermind. I got it. Thanks very much, Alpha!!

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Create new workbook from two existing worksheets from list of names

    Your welcome. Thanks for the feedback.

  6. #6
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create new workbook from two existing worksheets from list of names

    Hi Alpha,

    Very sorry, another question for you. Before each workbook is saved (or after, doesn't matter I guess), I need to have it emailed to a recipient and cc'ed to another recipient. The email TO email addresses are in range ("D2:D25") and the cc addresses are in range ("E2:E25"). Header for each email is the same as the file name, and email text is located in Cell B31. I have some experience in creating emails and attaching, but nothing like this.

    Any ideas?

    Thanks!

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Create new workbook from two existing worksheets from list of names

    This site has methods and example code to email from Excel.

    Mail from Excel with Outlook

  8. #8
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create new workbook from two existing worksheets from list of names

    Hey Alpha,

    Thanks again for the awesome coding help. I'm trying to have all external connections delete in each new workbook created and I'm having some trouble. I'm not getting any errors, but the connections are not deleting either. Here's what I have:

    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Create new workbook from two existing worksheets from list of names

    Correct me if I'm wrong, but I'm guessing you want to replace formulas that have links to external sources. If yes, this will replace all formulas (and any external links) with their values.

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create new workbook from two existing worksheets from list of names

    Hi Alpha,

    I was hoping the internal formulas would remain, just the formulas was with external links to be removed?

    Thanks!

  11. #11
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Create new workbook from two existing worksheets from list of names

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create new workbook from two existing worksheets from list of names

    Absolutely perfect. I was trying the method you used without success but I can see were I had it wrong as well. Thank you very much 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. Create new worksheets with names from a list
    By daniel_t in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-20-2013, 03:21 AM
  2. Create new workbooks and worksheets from an existing Workbook
    By nazmul in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-30-2008, 11:07 PM
  3. Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. [SOLVED] Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  6. [SOLVED] Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  8. Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-07-2005, 04:05 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