+ Reply to Thread
Results 1 to 8 of 8

excel macro to extract first three rows of excel files from a folder and create new file

  1. #1
    Forum Contributor
    Join Date
    04-09-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    176

    excel macro to extract first three rows of excel files from a folder and create new file

    Hi to all VBA Programmers,

    I have some excel files having data and all the files have same column names like this.

    Individuals color Rank
    1 red 1
    2 blue 2
    3 green 3
    4 yellow 4
    5 orange 5
    6 blue 6
    7 green 7
    8 orange 8
    9 yellow 9
    10 green 10

    Now I want to extract top three individuals from all the files in a folders based on Rank column (Basically selecting top rank Individuals) and I want to create separate new file with all the selected top three individual lists. Is it possibile to do with macro? because doing it manually taking so much time to achving my target for doing more than 150 files. I need help to solve this problem. Any help would be highly aprreciated. please see the attched example file for better understanding and sheet what and how i am expecting.
    Thanks in advance,

    Regards,
    Genetist
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: excel macro to extract first three rows of excel files from a folder and create new fi

    So, what would the output look like for the first 3 workbooks opened?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    04-09-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: excel macro to extract first three rows of excel files from a folder and create new fi

    Dear JBeaucaire,

    thank you very for your reply. I want final file contains information like this from all the files in a folder because all files have same column headings.

    Individuals color Rank
    1 red 1
    2 blue 2
    3 green 3
    like I want to extract information like this from all the files of folder.

    Regards,
    Genetist

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: excel macro to extract first three rows of excel files from a folder and create new fi

    So, after 3 files the output would be:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-09-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: excel macro to extract first three rows of excel files from a folder and create new fi

    Dear JBeaucaire,

    Yes exactly the same i wish to want to have after
    Thanks

    Regards,
    Genetist

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

    Re: excel macro to extract first three rows of excel files from a folder and create new fi

    So is the Rank column (in each Workbook) already sorted to show the top 3 ranks at the top?

  7. #7
    Forum Contributor
    Join Date
    04-09-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    176

    Re: excel macro to extract first three rows of excel files from a folder and create new fi

    Yes Dear Apo like that only i want
    Thanks

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

    Re: excel macro to extract first three rows of excel files from a folder and create new fi

    Hi..

    Try this.. change the strpath to suit..

    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. Macro to create hyperlinks for multiple unique excel files in a given folder
    By coop442s in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-26-2019, 03:23 PM
  2. Create folder, excel file, pdf file, clear details macro
    By cemartinho in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-16-2013, 08:52 AM
  3. Macro for copying specific data from excel files in a folder to a newly created excel file
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2012, 02:24 PM
  4. Replies: 3
    Last Post: 09-30-2011, 04:35 AM
  5. Replies: 1
    Last Post: 05-24-2007, 07:28 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