+ Reply to Thread
Results 1 to 6 of 6

Copy a worksheet and rename based on column values

  1. #1
    Forum Contributor
    Join Date
    07-01-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2016
    Posts
    161

    Copy a worksheet and rename based on column values

    I have two worksheets - one named MASTER and another named TEMPLATE. Is there a way to go through column A on MASTER that looks like this:

    A B
    1 A - Access
    2 A1 blah blah blah
    3 A2 blah blah
    4 FO - Followup
    5 FO1 blah blah blah
    6 FO2 blah
    7 FO3 blah blah

    So using column A, it should skip cells A1 and A4 (not "A###" or "FO##"), and then use TEMPLATE and create a copy of it (keeping all formulas and conditional formatting) renaming it to A1, A2, FO1, FO2, and FO3. Is this something that is easy to do?

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Copy a worksheet and rename based on column values

    Try this:
    Please Login or Register  to view this content.
    It removes the rows containing in A column the character -
    Click the * to say thanks.

  3. #3
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Copy a worksheet and rename based on column values

    I'm not 100% sure that this is what you were looking for. Just in case, here's my take on your requirements:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  4. #4
    Forum Contributor
    Join Date
    07-01-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2016
    Posts
    161

    Re: Copy a worksheet and rename based on column values

    WBD, it sort of works (no fault of yours). In my worksheet, some of the rows are are joined. For example if I have A5-A7 are joine, your will create a copy of TEMPLATE and name it FO1. This is good, but as the script goes through A6 and A7, it will create a "TEMPLATE (1)" and "TEMPLATE (2)" worksheet. How do I not create a copy in this instance?

  5. #5
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Copy a worksheet and rename based on column values

    Stop working with merged cells. That is a really bad practice. Instead of using A5-A7 for the same value, just use it 3 times. Merged cells are a visual display with no data manipulation and usually messes your data.

  6. #6
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Copy a worksheet and rename based on column values

    Well, that's not how you presented your data. You'd need to attach an actual example of what you're working with to allow me to adjust the macro; we can't just "guess".

    WBD

+ 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 and rename Template folder based on values in Excel
    By tejboyd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2017, 05:59 PM
  2. [SOLVED] Excel Macro to Rename each Worksheet based on Cell Values
    By arnel_10 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-09-2017, 05:32 PM
  3. Copy Worksheet based on Unique Column Values with Scatter Graph
    By jhall488 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2015, 12:25 PM
  4. Copy paste and rename folder based on Cell values
    By BrettRogersUK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2014, 04:54 AM
  5. Macro to auto copy entire row from master to worksheet based on column values
    By danielleferry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-20-2014, 11:22 AM
  6. Copy worksheet and rename based on cell range
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-08-2011, 06:53 AM
  7. Automated worksheet copy, rename based on cell results
    By humboldtguy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-01-2009, 01:11 AM

Tags for this Thread

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