+ Reply to Thread
Results 1 to 6 of 6

Need macro/vba that creates new sheets for each flake from a template sheet

  1. #1
    Registered User
    Join Date
    08-20-2018
    Location
    New york
    MS-Off Ver
    2016
    Posts
    21

    Need macro/vba that creates new sheets for each flake from a template sheet

    Hi!

    I need help creating some code that is above my head. Don’t have very much vba experience.

    Ideally I’d have a code activated by a button that creates a sheet for each row of data selected (example selected D8:D17 10 new sheets in this example) each sheet from a template worksheet I have saved in templates called YTemplate. (So not just a new blank worksheet but the template.

    It would be helpful if each new sheet had the data the in cell that it is created from input in each sheet. For example new sheet created for D8 would have the number D8 contained in a certain cell in the new sheet like cell B3 of the template sheet created.

    Thanks for your help on this!

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

    Re: Need macro/vba that creates new sheets for each flake from a template sheet

    It may be easier to have the Template sheet in the same workbook. You could hide the template sheet.

    What do you want to name the tabs of the new sheets?

    For each selected cell, this code duplicates a hidden Template sheet, puts the cell value in B3, and names the sheet as the cell value.

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 01-28-2020 at 12:45 AM.
    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
    Registered User
    Join Date
    08-20-2018
    Location
    New york
    MS-Off Ver
    2016
    Posts
    21

    Re: Need macro/vba that creates new sheets for each flake from a template sheet

    Hi AlphaFrog,

    I tried the code and it works to create another sheet. It does not seem to be putting the contents of the selected cell in the new sheet B3.

    I like your idea of keeping the Template as a hidden sheet that can work.

    Id like to name each sheet the contents of the selected cells and the cell to the right of the selected cell -> like formula =D8&E8. with that i can make sure there are no sheets being made with the same name and causing problems.

    Thanks So Much for your help!

    Edit:
    Actually I fixed the B3 problem by writing in ActiveSheet.Range.("B3")
    That part works quite well now.

    Is there any way to make this code run by a button I put on the original sheet?
    Last edited by Goakseeker; 01-28-2020 at 04:35 PM. Reason: update

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

    Re: Need macro/vba that creates new sheets for each flake from a template sheet

    Please Login or Register  to view this content.
    Assign a macro to a Form or a Control button

  5. #5
    Registered User
    Join Date
    08-20-2018
    Location
    New york
    MS-Off Ver
    2016
    Posts
    21

    Re: Need macro/vba that creates new sheets for each flake from a template sheet

    Thank you AlphaFrog!

    This works awesomely and will be so helpful for my project.

    I have another code question for you, but it is somewhat unrelated. Is it appropriate to ask it here or should I mark solved and make a new post?

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

    Re: Need macro/vba that creates new sheets for each flake from a template sheet

    You're welcome. Thanks for the feedback.

    Mark this solved and post a new thread.

+ 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: 1
    Last Post: 07-02-2019, 01:25 AM
  2. Error with macro which creates new workbook and pastes a template in
    By cheethamz17 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2016, 03:07 AM
  3. Replies: 5
    Last Post: 06-08-2013, 06:20 AM
  4. Fixing a macro that creates a template in Outlook 2007
    By kbuyle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2013, 04:51 PM
  5. [SOLVED] Macro that creates template based on list
    By nofzinger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-08-2013, 05:20 PM
  6. [SOLVED] macro that creates new sheets for changes in value
    By Steve99999 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2012, 10:43 AM
  7. macro creates new sheet with data from other sheets
    By jdcns in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-11-2011, 08:28 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