+ Reply to Thread
Results 1 to 12 of 12

loop through file creating seperate files depending on name in a column

  1. #1
    Forum Contributor
    Join Date
    03-20-2013
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    200

    loop through file creating seperate files depending on name in a column

    Hi

    i have file with approx 12,000 rows with columns A:I populated with data

    in column G is a name

    example rows 7:100 are rows for Tom Smith,

    i need a macro that will loop through all 12,000, then create seperate excel files for each name

    so first example would be one file with just tom smiths rows in it,
    second file be the next person

    is this atall possible?
    thanks

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: loop through file creating seperate files depending on name in a column

    Can be done with a Macro. If you are fine with separate Worksheets, instead of separate Workbooks, Pivot Tables can also help!.

    Can you attach a sample workbook?
    Cheers!
    Deep Dave

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: loop through file creating seperate files depending on name in a column

    See if this works for you.

    If not, need to see your workbook.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-20-2013
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: loop through file creating seperate files depending on name in a column

    hi thanks for the reply!

    on the attached, ive removed a lot of data so its just 200 lines, with 3 people - the end result being 3 seperate files by the 3 names in the file.

    the actual main file will always be 11,0000 - 12,0000 rows with around 50 people

    thanks
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: loop through file creating seperate files depending on name in a column

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    03-20-2013
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: loop through file creating seperate files depending on name in a column

    hi

    i get an evalute error at this point

    Please Login or Register  to view this content.
    thank you

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: loop through file creating seperate files depending on name in a column

    Working for me...
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    03-20-2013
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: loop through file creating seperate files depending on name in a column

    hi works perfectly on 200 rows, but my master file is 12,000 rows and it seems to spit up an error on there? thanks

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: loop through file creating seperate files depending on name in a column

    If you still get error then try this one.
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    03-20-2013
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: loop through file creating seperate files depending on name in a column

    perfect thank you

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: loop through file creating seperate files depending on name in a column

    You are welcome and thanks for the rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  12. #12
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: loop through file creating seperate files depending on name in a column

    I will sneak this one in for posterity..

    Used a couple of methods straight from snb's site.. as you can probably see..

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

+ 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] Get data from several seperate files to appear in a designated file
    By Doofus1 in forum Excel General
    Replies: 4
    Last Post: 07-02-2014, 02:02 PM
  2. Get data from several seperate files to appear in a designated file 2
    By Doofus1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-25-2014, 03:23 PM
  3. Replies: 0
    Last Post: 03-13-2013, 09:08 PM
  4. Creating a loop that will sort, copy, paste and save data into seperate workbooks
    By EggHead in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2009, 03:17 PM
  5. creating a date column from seperate data
    By T.O. in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-20-2005, 09:30 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