+ Reply to Thread
Results 1 to 6 of 6

Copy, create new tab, paste

  1. #1
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Copy, create new tab, paste

    Attached is a sheet in which the tab Pivot Table is created from data in the tab Date. I need a macro/vgb that would do the following:
    1) Copy the data for each customer in the Pivot Table(along with header)
    2) Create a new tab and name it specifically for each customer
    3) Auto-size the columns in the new tab

    I have manually created the 4 tabs that I need created automatically. The real application will have dozens of customers with dozens of part #'s. Some of the the customers names are too long & have characters in them that TAB names do not allow. The code will have to adjust for that.

    Thank you in advance for your help.
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,709

    Re: Copy, create new tab, paste

    Hi backyardfun,

    Try below code based on your sample file ..
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Copy, create new tab, paste

    Please try

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Copy, create new tab, paste

    it works great but some customer names have a / in it which kills it. Is there code that can be added that will look for the characters not allowed to be used in a TAB name and replace with _? Thanks.

  5. #5
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,709

    Re: Copy, create new tab, paste

    Make the below changes in blue ..
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Copy, create new tab, paste


+ 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. VBA Create new workbook and copy paste data
    By jayt91 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2014, 01:18 PM
  2. How to Create a Custom Copy and Paste Function
    By jlmissouri in forum Excel General
    Replies: 2
    Last Post: 01-16-2013, 12:07 AM
  3. Create, Copy, Paste to multiple Worksheets
    By MSchibs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-20-2011, 05:15 PM
  4. Need to create a button that can copy cells, create a new sheet and then paste there
    By torontoguy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-14-2009, 11:26 AM
  5. create macro to copy paste many rows at once
    By asaya in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2008, 03:47 PM
  6. [SOLVED] I need formula help or create a macro to copy and paste value only
    By Rebecca in forum Excel General
    Replies: 4
    Last Post: 04-08-2006, 08:25 AM
  7. Replies: 1
    Last Post: 10-17-2005, 04:05 AM

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