+ Reply to Thread
Results 1 to 3 of 3

MACRO - Creating Worksheets From Multiple Templates & a List

  1. #1
    Registered User
    Join Date
    05-25-2018
    Location
    US
    MS-Off Ver
    2007
    Posts
    2

    MACRO - Creating Worksheets From Multiple Templates & a List

    Please help!

    I have a macro that creates multiple worksheets from a list. It uses a single template worksheet, "TEMPLATE", but auto-fills information from the list / table on my "MASTER" tab...

    Private Sub CommandButton2_Click()
    Dim sh1 As Worksheet, sh2 As Worksheet, c As Range
    Set sh1 = Sheets("TEMPLATE")
    Set sh2 = Sheets("MASTER")
    For Each c In sh2.Range("A8", sh2.Cells(Rows.Count, 1).End(xlUp))
    sh1.Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = c.Value: ActiveSheet.Range("A8") = c.Value
    Next
    End Sub


    It's great... except it only allows me to reference one template worksheet. Ideally, I would like to have multiple template worksheets ("TEMPLATE 1", TEMPLATE 2", etc.) that I can assign individually to items on the list (probably with a drop-down list). That way, I can select which template file the macro copies for each individual item on the list. I'm hoping to accomplish this with one button after the fields have been filled out in the "MASTER" tab.

    Thoughts? Suggestions? Prayers?

    Thanks!

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: MACRO - Creating Worksheets From Multiple Templates & a List

    Typicaly a template sheet is used as a pattern for the formatting (column widths, headers, number formats) of the cells in the newly created sheet.

    If you have two Templates, that have different formatting for a cell, what formatting would that cell on the created sheet get?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    05-25-2018
    Location
    US
    MS-Off Ver
    2007
    Posts
    2

    Re: MACRO - Creating Worksheets From Multiple Templates & a List

    Quote Originally Posted by mikerickson View Post
    Typicaly a template sheet is used as a pattern for the formatting (column widths, headers, number formats) of the cells in the newly created sheet.

    If you have two Templates, that have different formatting for a cell, what formatting would that cell on the created sheet get?
    Yes, some of the aesthetic formatting would be different for each of the template worksheets. However, the main differences would be formulas and different drop-down menus. I have already created the template worksheets - I just need a way to duplicate them / assign them to items on my master list.

+ 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. Replies: 8
    Last Post: 11-16-2014, 06:34 PM
  2. Update existing macro that splits a list into worksheets to split into templates instead
    By Graeme-Black in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2014, 04:19 PM
  3. [SOLVED] Creating a list of data pulled from multiple worksheets
    By mzbreski in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-22-2012, 10:12 PM
  4. Creating Multiple charts from templates
    By jhelliar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-16-2011, 08:17 AM
  5. macro for creating chart for multiple worksheets
    By samicat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2010, 02:56 PM
  6. Creating List of Data from Multiple Worksheets
    By narrowgate88 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-18-2009, 09:37 AM
  7. Creating Required Worksheets from Various Templates
    By modytrane in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-29-2008, 08:08 PM

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