+ Reply to Thread
Results 1 to 14 of 14

New sheet related to template sheet with name

  1. #1
    Registered User
    Join Date
    02-27-2019
    Location
    Slovenia
    MS-Off Ver
    2016
    Posts
    26

    New sheet related to template sheet with name

    Hello all,

    I would be very grateful, if someone can help me with VBA code, because I am not an expert in this.


    My idea is next, I have MainSheet, where I will put different names (1, 2, 3,....), each in separate cell in column. Also I have TemplateSheet with always the same datas. I would like to have button, which will generate new TemplateSheet
    with its name related to input in cell.

    I hope, that I was clear and it is understandable.


    Many thanks in advance.

    e123.jpg

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: New sheet related to template sheet with name

    Your Proposed Solution is Messy and frankly pointless.

    1. You do not need buttons.

    2. Once Created what is the point of your Main Sheet

    I have created a sample document for you.

    Macro1.
    Right Click On Your Sheet Name At the Bottom Of Excel and Select View Code

    Click on any green cell in column A of the Index Sheet one of two things will happen.
    1. If the Sheet Exists then that sheet will be activated.
    2. If that sheet does not exist then it will be created.


    Macro2.
    Select the Developer Tab. Select Visual Basic. Select view "Project Explorer". Select your project and click on "This Workbook"
    Double Click on any cell on any sheet and the Index Sheet will be activated.
    Attached Files Attached Files
    Last edited by mehmetcik; 10-30-2020 at 07:52 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: New sheet related to template sheet with name

    If you simply want to create a copy of the Template and name it using the values you enter in a column, using a different button for each value is not very practical. You can do what you requested by entering a value in a cell and simply pressing the RETURN key, no buttons are necessary. Would that work for you? If it would, in which column would you be entering the values to be used as sheet names?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Registered User
    Join Date
    02-27-2019
    Location
    Slovenia
    MS-Off Ver
    2016
    Posts
    26

    Re: New sheet related to template sheet with name

    Hello mehmetcik

    this document will help me control and maintenance my projects. In my Main Sheet I will have sum of all my projects with all main datas. In each separate sheet (named after project name) I will
    have detailed informations of projects, pictures, notes,....



    This is just my idea, any other solution is also welcomed.


    Many thanks!

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: New sheet related to template sheet with name

    Try the attached sample file. In the MainSheet, type a value in column A and press the RETURN key. Does this do what you requested?
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-27-2019
    Location
    Slovenia
    MS-Off Ver
    2016
    Posts
    26

    Re: New sheet related to template sheet with name

    Hello Mumps1

    it will works too! Is it possible, that each next sheet is generated after previous one, now excel generate it before previously generated sheet.

    If there is also any solution with button will be glad, because maybe other users will use this document, and now only I know, that I need to press return key (if there is a button, evertyhing is clear).

    Many thanks!

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: New sheet related to template sheet with name

    My Code Places each sheet at the end of the workbook. See Post number 2.


    Please Login or Register  to view this content.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: New sheet related to template sheet with name

    Try the attached file. It is possible to use buttons but that would mean that each button would have to have its own macro assigned to it. So if you have 5 buttons, you would need 5 macros. Then if you add any new buttons, you would have to reproduce the macro for each new button and change the cell reference to the appropriate sheet name. That is not very practical.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-27-2019
    Location
    Slovenia
    MS-Off Ver
    2016
    Posts
    26

    Re: New sheet related to template sheet with name

    Many thanks to both mehmetcik and Mumps1, all solutions will do the yob!

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: New sheet related to template sheet with name

    You are very welcome.

  11. #11
    Registered User
    Join Date
    02-27-2019
    Location
    Slovenia
    MS-Off Ver
    2016
    Posts
    26

    Re: New sheet related to template sheet with name

    mehmetcik,

    in your first macro some errors appear:

    1. When I select the whole row

    Attachment 702060


    2. When I select two cells:

    Attachment 702061


    Help with this is very appreciated.
    Last edited by Blaz_SLO; 10-30-2020 at 09:42 AM.

  12. #12
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: New sheet related to template sheet with name

    Try this code:

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    02-27-2019
    Location
    Slovenia
    MS-Off Ver
    2016
    Posts
    26

    Re: New sheet related to template sheet with name

    Hello mehmetcik,

    another additional problem occurred. When I double click in any cell in newly generated sheet (also in template sheet), Im redirected back to my Index sheet.

    Is there any solution to this?



    I must say, that your code for now is very useful.


    Many thanks!

  14. #14
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: New sheet related to template sheet with name

    As I explained in post no 2.

    I place a macro in the This Workbook module to take you to the Index sheet on a double click. Delete it if you do not want it. But you will find it useful.


    Select the Developer Tab. Select Visual Basic. Select view "Project Explorer". Select your project and click on "This Workbook"

+ 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 template sheet to a new sheet with the code in the teimplate sheet
    By BRISBANEBOB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-17-2018, 10:41 PM
  2. [SOLVED] Copy Template Sheet and rename the new sheets based on a list in another sheet
    By SaadKiji in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2016, 11:47 AM
  3. Copying a template sheet's content to a series of newly created sheet tabs.
    By ZootlyData in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-17-2016, 04:01 AM
  4. Replies: 1
    Last Post: 01-04-2014, 06:37 PM
  5. [SOLVED] Create new sheet from template, auto fill from index sheet and hyperlink
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2013, 04:57 AM
  6. [SOLVED] Worksheet Activate when user selects sheet NOT when sheet is created from a template sheet
    By y0rk1e72 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-26-2012, 02:47 PM
  7. Copying a template sheet and putting those multiple sheets data into a summary sheet
    By John Wolfe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2011, 06:29 PM

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