+ Reply to Thread
Results 1 to 9 of 9

Create unique # of worksheets based on list count with unique names

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Create unique # of worksheets based on list count with unique names

    Hi everyone,

    I have a list of unique numbers in column A of worksheet "Master". What I need is for a macro to count the number of cells in column A that have data in it, create that number of worksheets - 1 (since the Master worksheet is also represented in the first cell in column A), and then name the worksheets as the unique numbers in column A starting at A2.

    Any ideas? your help would be greatly appreciated.

    Thanks!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Create unique # of worksheets based on list count with unique names

    Hi,

    Before going too far can I ask what use you will make of the individual worksheets?

    I ask since we're always being asked about reporting summary information based on data spread around many worksheets and usually without exception the response points out that in order to simplify reporting the data should always be on a single sheet in a regular database layout.

    Keeping data on a single sheet means that you can easily filter it when you want to view subsets of it, and if there's a necessity to list a subset on another sheet then just have a template sheet which gets populated with the relevant data at run time. There's usually no real need to have subsets of data on many sheets.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Create unique # of worksheets based on list count with unique names

    To try the macro, open the attached workbook and {ctrl} + q


    Please Login or Register  to view this content.
    Note
    This creates a new sheet for every value in column A unless it already exists
    Attached Files Attached Files
    Last edited by Kevin#; 05-20-2016 at 10:49 AM.
    If a response has helped then please consider rating it by clicking on *Add Reputation below the post
    When your issue has been resolved don't forget to mark the thread SOLVED (click Thread Tools at top of thread)

  4. #4
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create unique # of worksheets based on list count with unique names

    Hi everyone,

    So I have the following code thus far:

    Please Login or Register  to view this content.
    This works well, except I need the sheets to be duplicates of a sheet called "Master". They will still be given unique names based on the list, but the sheets themselves need to be format duplicates of the "Master" sheet.

    Any ideas?

    Thanks!

  5. #5
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Create unique # of worksheets based on list count with unique names

    Here is the macro I gave you earlier, tailored to your latest request:

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Create unique # of worksheets based on list count with unique names

    For your macro in post#04

    Try adding this
    Please Login or Register  to view this content.
    after
    Please Login or Register  to view this content.
    I have not tested it with your macro, but it works in mine!!

  7. #7
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create unique # of worksheets based on list count with unique names

    Hey everyone, thanks for your help thus far. I've been researching and I have the following code that effectively does what I want with one exception:

    Please Login or Register  to view this content.
    What I would like to do, is instead of defining column AF to get the values for the list, I would like a value entered in textbox SP_V (this textbox is in Userform1) searched across worksheet("Master").Range("W1:BA1"), and whichever column the SP_V value is found in, that's the column the StuffSheets macro would work from.

    I'm thinking the Find function would be somewhere in the following lines, but I'm really not certain:
    Please Login or Register  to view this content.
    Any ideas?

    Thanks everyone!!

  8. #8
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Create unique # of worksheets based on list count with unique names

    I am confused by all the jumping about here
    You are asking for help but then post your own code
    How does post#01 develop into post#04 which then jumps to post#07 ?

  9. #9
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create unique # of worksheets based on list count with unique names

    Hi Kevin,

    Sorry about the confusion. I've been rewriting the code as I've been posting. At this point, all I'm trying to figure out is how to search a value entered in textbox SumPoint_V in range worksheet("Master").Range("W1:BA1") so the rest of the code can operate in the column the value was found in.

+ 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. Create a list that contains duplicates and unique names and no blanks
    By Whard42 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 06-24-2015, 08:43 AM
  2. Count Number of Unique Names in a List
    By acewriter63 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-09-2012, 09:12 AM
  3. [SOLVED] Count unique values and create list based on these values
    By vipa2000 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  4. Count unique values and create list based on these values
    By vipa2000 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. Count unique values and create list based on these values
    By vipa2000 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  6. Count unique values and create list based on these values
    By vipa2000 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-04-2005, 09:05 PM
  7. Count Unique Names in list w/ Additional Criteria?
    By Nodak in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-25-2005, 08:06 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