+ Reply to Thread
Results 1 to 8 of 8

Creating Sheets from a Template

  1. #1
    Registered User
    Join Date
    07-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    39

    Creating Sheets from a Template

    My process begins with the "Monthly" worksheet. I receive the worksheet and need to populate my template workbook with the data in the following manner:
    Assumptions:
    1. The template workbook contains the Summary worksheet and 1 detail worksheet only populated with Headers.

    Here's what needs to happen:
    1. The information contained in the "Monthly" worksheet needs to populate my template workbook in the following manner:
    - The detail template sheets need to copy themselves and populate with select data located in each row
    of the "Monthly" sheet i.e. 1 row of data per worksheet
    2. The worksheets need named according to the data listed in (Column B) of the "Monthly" worksheet.

    DETAILS:
    The data in the "Monthly" worksheet(Columns B:F) needs populated in my template workbook into (Columns A:E, Row3) creating seperate detail worksheets for each row listed on the "Monthly" worksheet.
    After creating the worksheets they need named either from the data located in the detail sheet (Column A, Row 3) OR by taking the data in the "Monthly" (Column B) and naming the worksheets from there.

    THE CATCH
    The "Monthly" worksheet data is seperated into template workbooks based on the value in (Column E). Normally I need to sort by (Column E) first, then create template workbooks, then populate those workbooks. (which I can still do) Someone told me I should try and write a macro to create the template workbooks first then populate them, however, it all seemed overwhelming so I gave up on that part. I figued if I could get it to autopopulate I could delete text in my "monthly" worksheet and run the macro on the needed data only however many times I had to do it.
    Attached Files Attached Files
    Last edited by CRW; 08-01-2012 at 12:08 PM.

  2. #2
    Registered User
    Join Date
    07-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Creating Sheets from a Template

    Bump - No Response

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Creating Sheets from a Template

    Your Template file sheet wk1 has many entries from rows 4 to 11. From where does that data come in?

    Also, once the template has been copied and the sheet created, do you want to clear out the entries from the monthly tab?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    07-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Creating Sheets from a Template

    Sorry it took me so long to respond. The numbers are entered later after the template is populated. It is irrelevant. I only need to take the data located in Columns B:F of the monthly worksheet and populate the template with a worksheet for each row of data in the Monthly worksheet. So 1 worksheet gets populated in the template workbook for each row my monthly worksheet has but I only need to pull over the data located in Columns B:F of the Monthly worksheet. So in my example my template workbook after running the macro would have the summary sheet with nothing on it and 4 worksheets with the data from the monthly worksheet taken and placed in each worksheet of the template workbook Colums A:E Row 3.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Creating Sheets from a Template

    The Monthly sheet has 4 rows of data.

    The Template workbook doesn't have a sheet called "template", it has on called wk1, so that's the template?

    What would the 4 new worksheets be called once they were created? Is wk1 still there as the template? (very confused)

    Lastly, does this macro run FROM the template workbook, FROM the Monthly workbook, or FROM somewhere else (thus it would need to refer to both workbooks by some standard location?)
    Last edited by JBeaucaire; 08-09-2012 at 09:25 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Creating Sheets from a Template

    This macro will do what you want. You need only edit the PATH to locate the template workbook on your computer.

    The macro can be run from anywhere, perhaps store it in your Personal.xlsb so it's available at all times.

    The macro confirms that the current sheet onscreen is the "due" data you want to process, so that needs to be true. Then it will open a copy of the template, create sheets and stop.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Creating Sheets from a Template

    I can not believe it. This works perfectly. Thank you so much! And by putting the comments in helped me to understand what each step was actually doing which makes much more sense to me now.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Creating Sheets from a Template

    If that takes care of your need, please select Thread Tools from menu above and set this topic to SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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