+ Reply to Thread
Results 1 to 9 of 9

Create and save as a new workbook

  1. #1
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Create and save as a new workbook

    Dear All,

    I have 1 workbook and there are some sheets. I want to save all sheets as new workbook in the specific destination folder. But workbooks name should be same as in sheet.

    Please find attached. For example, sheet1 name is "1", sheet2 name is "2" and ...... Saved files should be equal to sheet names.

    Could you please help.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: Create and save as a new workbook

    This should do the trick:
    Please Login or Register  to view this content.
    B/R
    Erwin

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Create and save as a new workbook

    You don't have to select the sheets prior to copying.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Create and save as a new workbook

    Thanks to all but it is thinking 10-12 seconds even there are 2 sheets when I run code. Maybe we need to add some codes to speed up the process?

    Thanks in advance.

  5. #5
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: Create and save as a new workbook

    you could add the Application.ScreenUpdating property in your macro; it will speed up things!
    set it to False in the beginning of the macro and to True at the end.
    B/R
    Erwin
    Last edited by Eastw00d; 03-05-2020 at 11:06 AM. Reason: typo
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Create and save as a new workbook

    Then something else is causing the delay because just tested the code on your example workbook and with screenupdating set to false it just took 3sec. to copy the 6 sheets.(4.5 without screenupdating)

    You could also try setting Calculation to manual at the start (set back to Automatic at the end)

  7. #7
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Create and save as a new workbook

    Thanks to All!

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Create and save as a new workbook

    Thanks for feedback.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  9. #9
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Create and save as a new workbook

    Thanks and Done.

+ 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] Create a new workbook with a new name and save to desktop
    By Grilleman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-04-2019, 04:52 PM
  2. [SOLVED] Create, rename, and save new worksheet and workbook
    By peihsin.lee in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2017, 05:04 AM
  3. Create and Save a new Workbook issues
    By BuenosDias in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2014, 11:27 AM
  4. [SOLVED] Create and Save Workbook to Current Directory Using VBA
    By amanda12345 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-23-2013, 10:13 PM
  5. [SOLVED] Automatically create a workbook for each sheet and save it as a txt
    By simone77 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2013, 08:01 AM
  6. Macro to create workbook (save)
    By step_one in forum Excel General
    Replies: 3
    Last Post: 09-06-2011, 06:57 PM
  7. Macro to create new workbook and save it after formatting
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2011, 07:13 AM

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