+ Reply to Thread
Results 1 to 5 of 5

VBA copy MASTER sht when new entry to the table is made and name it as the cell value

  1. #1
    Registered User
    Join Date
    04-01-2010
    Location
    Worcester, UK
    MS-Off Ver
    Microsoft 365 (subscription)
    Posts
    50

    VBA copy MASTER sht when new entry to the table is made and name it as the cell value

    I need help a.s.a.p. please.

    I would like to be able to have a macro, working automatically, so that when you add next entry in the table it creates a copy of MASTER sheet and name it as the cell value.

    I.e. If I add following data in the table:
    Argentinos Juniors (A2)
    Volga Novgorod (A3)
    Real Salt Lake (A4)

    it (macro) automatically creates 3 sheets (copies of MASTER sheet), name them as the cell values (so Argentinos Juniors, Volga Novgorod and Real Salt Lake) and put it's (sheet) name in cell B1 of this sheet.
    Also in SUMMARY sheet table is filled in automatically with cells in columns B i C (formulas as in above row).

    I need also something to protect already created inputs (and sheets) so if somebody is altering (or deleting) any record in the table macro is asking if the sheet name needs to be changed or sheet needs to be deleted and deleting it (or changing name).
    For duplicate input (so if someone will input for example Argentinos Juniors again) it needs to create sheet named Argentinos Juniors 2, Argentinos Juniors 3 etc... and changed input in column A so it will be also Argentinos Juniors 2, Argentinos Juniors 3 etc.

    Thanks for any support!
    I have attached sample workbook so it will be easier to understand what I need... hopefully.


    Also posted on bigresource.com:
    http://excel.bigresource.com/Track/excel-ej1s98DX/
    Attached Files Attached Files
    Last edited by jarssonn; 06-03-2011 at 01:58 PM.

  2. #2
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: VBA copy MASTER sht when new entry to the table is made and name it as the cell v

    Hi,

    Maybe give this a try,
    Just enter a name in the names worksheet and the script will create a copy of the master sheet and name it with the name you put in and will place it after the master sheet. It will also put the name of the sheet in b1

    Let me know of any issues.

    .
    Attached Files Attached Files
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

  3. #3
    Registered User
    Join Date
    04-01-2010
    Location
    Worcester, UK
    MS-Off Ver
    Microsoft 365 (subscription)
    Posts
    50

    Re: VBA copy MASTER sht when new entry to the table is made and name it as the cell v

    Hi! Thanks for quick reply. Unfortunately file you've attached has corrupted after I've downloaded it. I have tried several times with no success. Could you please attach it once again.

    Many thanks

  4. #4
    Registered User
    Join Date
    04-01-2010
    Location
    Worcester, UK
    MS-Off Ver
    Microsoft 365 (subscription)
    Posts
    50

    Re: VBA copy MASTER sht when new entry to the table is made and name it as the cell v

    Finally I've managed to download your sample file - it works fine.
    I have implemented your code into my workbook.
    I just need few more cosmetic add-ons - basically when I am adding next club in column A
    macro is creating copy of Master sheet and naming it as a cell value. What I need is column B and C being filled in with formulas as first row in table (entry for Master).
    Also when your entry already exist in the table, sheet created is named with number i.e. Argentinos Juniors 2, Real Salt Like 3 etc. - then macro needs to change entry in column A so it's Argentinos Juniors 2 as well (not Argentinos Juniors!) otherwise formulas in columns B and C will not work.
    And last thing (last I could spot so far...) when you change the entry name or delete any entry - macro needs to ask question (or something like that if possible) whether you want to change the name of this entry and if you accept it it changes name of tab as well or if you want to delete entry completely it needs to ask question whether you want this and after it's accepted macro needs to delete related tab.

    I hope it's not to complicated what I would like to get.

    Many thanks for help and I hope I am not being pain in the a** adding more and more...

    PS. Attached my workbook with code so far...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-01-2010
    Location
    Worcester, UK
    MS-Off Ver
    Microsoft 365 (subscription)
    Posts
    50

    Re: VBA copy MASTER sht when new entry to the table is made and name it as the cell v

    Can anyone help me with above please?

    Any help appreciated.

+ 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