+ Reply to Thread
Results 1 to 7 of 7

Macro for creating new sheets based on unique values in a row...

  1. #1
    Registered User
    Join Date
    08-05-2014
    Location
    Florida
    MS-Off Ver
    10
    Posts
    3

    Macro for creating new sheets based on unique values in a row...

    I've searched the web and found numerous similar examples to what I want, but I can't quite get them to work the way I want.

    I have approximately 20 sheets, each with a list of names in a row, with corresponding data for each name. I want to run a macro on each sheet to create a new sheet for each name and copy the corresponding row to that sheet. Then I want to run the macro on my next master sheet, and copy the rows associated with those names to the previously created 'name sheets' that were created, placing the new row of data directly under the previous data that was moved. So on and so forth, for each of my 20 sheets.

    Hopefully that makes sense. Any help is greatly appreciated!

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,719

    Re: Macro for creating new sheets based on unique values in a row...

    Are these 20 sheets what you call master sheets?
    How are they named?
    Could it be that the list of names are in a column, not in a row? (copy the corresponding row etc etc)
    Is there a chance that there are different or new names in any of the 19 sheets after you worked on the first "master" sheet?

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,719

    Re: Macro for creating new sheets based on unique values in a row...

    Are these 20 sheets what you call master sheets?
    How are they named?
    Could it be that the list of names are in a column, not in a row? (copy the corresponding row etc etc)
    Is there a chance that there are different or new names in any of the 19 sheets after you worked on the first "master" sheet?

  4. #4
    Registered User
    Join Date
    08-05-2014
    Location
    Florida
    MS-Off Ver
    10
    Posts
    3

    Re: Macro for creating new sheets based on unique values in a row...

    I apologize, I misexplained.

    Yes, the 20 sheets are 'master sheets' if you will. They are actually sheets for different years, so I have one for each year, going back 20 years.

    The names are listed in column A, going down rows (approximately 150). So I want to create a new sheet for each name (so ~150 new sheets).

    Hopefully that makes more sense.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,719

    Re: Macro for creating new sheets based on unique values in a row...

    Try this on a copy of your workbook.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-05-2014
    Location
    Florida
    MS-Off Ver
    10
    Posts
    3

    Re: Macro for creating new sheets based on unique values in a row...

    Thanks for the help.

    I get an error when I run that code: Run time error code 13, type mismatch.

    The line of code highlighted is:

    If Not Evaluate("ISREF('" & c.Value & "'!" & c.Address & ")") Then

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,719

    Re: Macro for creating new sheets based on unique values in a row...

    Use a function instead to check if the sheets exist.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

+ 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. Replies: 3
    Last Post: 07-08-2014, 03:10 PM
  2. [SOLVED] count unique values across multiple sheets based on date
    By roninn75 in forum Excel General
    Replies: 8
    Last Post: 02-25-2014, 05:20 PM
  3. [SOLVED] Find Common Values across multiple sheets based on Unique ID
    By desibabuji in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-12-2014, 05:38 PM
  4. [SOLVED] Need help creating new sheets based on values on a title sheet
    By thesteve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2013, 07:24 AM
  5. Create Sheets based on unique values in Column
    By Hblbs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-20-2009, 08:25 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