+ Reply to Thread
Results 1 to 11 of 11

Need to split a LONG list into separate sheets based on repeating, incremental nunbers

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Florida, United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    Need to split a LONG list into separate sheets based on repeating, incremental nunbers

    Hello all,

    This is my first post, so if I've neglected some other more appropriate channel for this question please let me know.

    I have a long list of participant numbers, and scores from a particular task, and I need to separate each participant's data into a separate worksheet. Their number repeats throughout the sheet (due to the nature of how I extracted it), and each person has 2 session's worth of data (stored in 2 sets of columns). Any help would be greatly appreciated, as my other option involves lots of cut/copy/pasting...I have attached the workbook in question.


    eprime.xls

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Need to split a LONG list into separate sheets based on repeating, incremental nunbers

    Hello,

    I dont follow what it is exactly your wanting. Can you create one sheet inside of the workbook of what the output should be?

    Thanks Mike

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Florida, United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Need to split a LONG list into separate sheets based on repeating, incremental nunbers

    Hey,

    Here's a version with an 'example' sheet included

    eprime_ex.xls

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Need to split a LONG list into separate sheets based on repeating, incremental nunbers

    Heres a code and function that will due what you want. The function is to make sure the new sheet name is valid

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-31-2012
    Location
    Florida, United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Need to split a LONG list into separate sheets based on repeating, incremental nunbers

    It's giving me a
    "compile error:
    variable undefined"
    and selecting the Sub while highlighting 'ws' in this line of code:
    " For Each ws In Worksheets "

    I inserted a new module and copied the code into it in the VBA editor. Should I have split the Sub from the Function or is this something else?

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Need to split a LONG list into separate sheets based on repeating, incremental nunbers

    Add

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-31-2012
    Location
    Florida, United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Need to split a LONG list into separate sheets based on repeating, incremental nunbers

    Awesome, that got it running. Only thing is these computers I have to use are ancient, and something causes the program to crash before it finishes. I get an 'cannot complete task with available resources: use less data' error and it says range copy failed.

    The debug stops here:
    Please Login or Register  to view this content.
    so perhaps it keeps stacking data in the clipboard and it runs out of space? if you know how to fix this, awesome, if not I think I can get it to work by splitting the main file into more manageable chunks for these computers.
    Last edited by Cutter; 07-31-2012 at 04:53 PM. Reason: Added code tags

  8. #8
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Need to split a LONG list into separate sheets based on repeating, incremental nunbers

    Im not sure what that problem could be. Maybe your computers memory is lacking because all sheets is held into memory. Also excel 2003 can only have 255 worksheets in workbook.

  9. #9
    Registered User
    Join Date
    07-31-2012
    Location
    Florida, United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Need to split a LONG list into separate sheets based on repeating, incremental nunbers

    It very well could be the memory, as I'm not working with that many sheeets, plus these are work computers and are known around the lab for being infamously bad. Thank you so much for your help though, I can figure this out from here!

  10. #10
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Marking threads solved.

    Please remember to mark your post as solved.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  11. #11
    Registered User
    Join Date
    07-31-2012
    Location
    Florida, United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Marking threads solved.

    whoops! I marked it (I think...). thanks for the reminder.

+ Reply to Thread

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