Results 1 to 5 of 5

Copy "Template" worksheet, Paste, and Rename -then add more ws's as customer list changes.

Threaded View

  1. #1
    Registered User
    Join Date
    05-01-2012
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2010
    Posts
    4

    Question Copy "Template" worksheet, Paste, and Rename -then add more ws's as customer list changes.

    I am working with a Workbook that contains a Template worksheet and a CustomerMaster worksheet. I use the script below to make a copy of the Template, and rename the copied template based on Column A of the CustomerMaster worksheet. The Customer Information changes from time to time on CustomerMaster (Customers are added to the list but never removed). My challenge is this. I need to create worksheets for each newly added customer, without modifying the already copied and renamed worksheets produced by running the VBA previously. So I would like to modify my VBA script to only create a template worksheet for newly added Customers only in Column A of CustomerMaster.

    Public Sub CopyData()
    ' Determine how many Dealers are on Master Sheet
    FinalRow = Range("A65000").End(xlUp).Row
    'Loop through each Dlr Acct # on the data sheet
    For x = 2 To FinalRow
    LastSheet = Sheets.Count
    Sheets("CustomerMaster").Select
    Dlr = Range("A" & x).Value
    'Make a copy of TEMPLATE and move to end
    Sheets("Template").Copy After:=Sheets(LastSheet)
    'Rename the Sheet
    Sheets(LastSheet + 1).Name = Dlr
    Next x
    
    End Sub
    Please help!

    Thanks,

    Adam
    Last edited by arlu1201; 05-01-2012 at 02:17 PM. Reason: Please put code tags in future.

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