Results 1 to 8 of 8

Copy tab with custom name without duplication

Threaded View

  1. #1
    Registered User
    Join Date
    06-09-2011
    Location
    Leeds, UK
    MS-Off Ver
    MS Office 2016
    Posts
    77

    Copy tab with custom name without duplication

    Hello.. Hope all are doing well.
    I'm trying create multiple copy of a Template tab/sheet based on the table on Index tab. On Index tab i have a table Emp_ID (col A), Emp_name (col B) and Tab_name (Col C). The macro will create a copy of Template tab, set the tab name as Index col C tab name and take Emp_Id and Emp name and put it on E2 and E3 of new tab. The below macro is working fine.
    Sub CreateTab()
    Dim r As Range
    For Each r In Sheets("Index").Range("C2:C5")
        If r.Value <> "" Then
            Sheets("Template").Copy after:=Worksheets(Worksheets.Count)
            ActiveSheet.Name = r.Value
            Range("E2").Select
            ActiveCell.FormulaR1C1 = r.Offset(0, -2).Value
            Range("E3").Select
            ActiveCell.FormulaR1C1 = r.Offset(0, -1).Value
        End If
    Next
    End Sub
    Now i want to put a process to avoid creating duplicated tab. Means if i add more entry to Index table and run the macro then it will copy Template and create tab for the new entries only. For existing entries where a tab is already exist, it should not create duplicate tab. how do i do it?
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy entry into a range if there is no duplication
    By GIS2013 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-04-2014, 06:03 PM
  2. [SOLVED] Row detection copy paste duplication
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2013, 08:40 PM
  3. copy custom range on value select
    By i.rajput in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2013, 06:15 AM
  4. VBA - copy cell value duplication issue
    By Dream Ahead in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2012, 03:52 PM
  5. Replies: 0
    Last Post: 06-13-2011, 04:53 PM
  6. Excel Live Sheet Duplication / Copy
    By scoopster in forum Excel General
    Replies: 2
    Last Post: 12-12-2007, 05:28 AM
  7. How can I copy a custom toolbar & put it on another pc?
    By R_Adams in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-09-2006, 02:50 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