+ Reply to Thread
Results 1 to 4 of 4

Duplicating worksheets from template worksheet and rename them from a list of values

  1. #1
    Registered User
    Join Date
    10-03-2019
    Location
    Switzerland
    MS-Off Ver
    Office 365
    Posts
    1

    Duplicating worksheets from template worksheet and rename them from a list of values

    Hi everyone,

    I need to create a spreadsheet with 665 worksheets that are named after a list of 665 values. Those worksheets have to be duplicated from a template worksheet because they all have to have the same basic formatting and a few formulas in a table. How to automatically create worksheets named from a list of values, but I don't know how to combine that with duplicating them from a template worksheet.

    The list of values is "list!A2:A666" if anyone has a template sub already.
    The template worksheet is named "template"

    My question is how I can combine the worksheet.copy with the naming from a list and how to loop it for 665 times.

    Thanks in advance!
    Last edited by Verioon; 10-03-2019 at 09:51 AM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Hi !

    Should we guess for the template worksheet ?‼

    See the Worksheets.Copy method in the VBA help to create a worksheet from a template worksheet …

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    I misread a little …

    So use a For Each loop from the source range like For Each V In[list!A2:A666].Value2 (there is a space after In …)
    as V is a Variant Variable for each Value
    then you can copy the template and rename the new worksheet according to V

    665 worksheets : I hope it's for your eyes only ! (Limit insane, how to manage so many …)
    Last edited by Marc L; 10-03-2019 at 10:09 AM. Reason: typo …

  4. #4
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Duplicating worksheets from template worksheet and rename them from a list of values

    See attached sample. click on the Copy button.

    Hope it helps.

    here's the simple macro used:

    Sub duplicate()

    Please Login or Register  to view this content.
    Attached Files Attached Files
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

+ 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] Copy and rename Template folder based on values in Excel
    By tejboyd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2017, 05:59 PM
  2. Copy template sheet and rename according to list
    By tkensen89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2015, 05:13 PM
  3. [SOLVED] From Template Worksheet – Copy, Rename, & End In Ascending Order
    By DDM64 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-06-2013, 06:12 PM
  4. Replies: 4
    Last Post: 05-02-2012, 08:47 AM
  5. Using VBA to rename worksheets when a cell changes in first worksheet
    By Topdog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2012, 05:09 AM
  6. duplicating values to different worksheets
    By lester in forum Excel General
    Replies: 1
    Last Post: 07-27-2006, 11:25 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