+ Reply to Thread
Results 1 to 8 of 8

sorting on lots of worksheets

  1. #1
    Registered User
    Join Date
    09-15-2011
    Location
    Workington, Cumbria
    MS-Off Ver
    Excel 2010
    Posts
    4

    sorting on lots of worksheets

    i have a problem which i'm not sure can be sorted

    The problem is as follows:

    I have 100's of excel documents which i need to sort by date and place the results into a new excel workbook.

    The excel documents all have a similar format in which they include the words:

    Date: (The invoice date) & Invoice number (The Invoice number)

    Is it possible to look to all the excel files and pull the information of :

    Date & Invoice number.

    and make a new excel file containing all this information and then sort it on Date

    example:

    Excel file 1: Name: Egremont Day Nursery.xls
    Excel file 2: Name: Keswick Police Station.xls
    Excel file 3: Name: Magistrades court.xls

    and so forth

    all the files have a similar format:

    Date: 11 April 2004
    Invoice Number: BARB001

    ect.

    Can excel look at each of these files find the the cell named date & Invoice number pull the data from them and write it to seperate file

    1. Date: 11 April 2004 Invoice Number: Barb001
    2. Date: 12 April 2004 Invoice Number: Barb002

    and so on.

    Hope this makes sense.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: sorting on lots of worksheets

    Can you attach maybe a couple of examples from your list of hundreds?

    Are all these workbooks in the same folder?
    Martin

  3. #3
    Registered User
    Join Date
    09-15-2011
    Location
    Workington, Cumbria
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: sorting on lots of worksheets

    All the files are store in a parent folder split into subs folders:

    Parent Folder

    is then split into

    Builders
    Business
    Church
    Private
    Schools

    split further

    Builder1
    Builder2
    Builder3

    Business1
    Business2

    (Ect.)

    And then

    2004
    2005
    2006
    2007
    2008
    2009
    2010
    2011

    and then

    List of excel files

    1. invoice 1.xls
    2. invoice 2.xls
    (And so on)


    I have included a template of the excel files format

    i need to search all the files above and extract the Date,Invoice Number,Date work completed (All the excel files are the same format)

    Then i need to save all the data into a main worksheet so i can sort them in order of date and give each one a unique number 001,002,003......9999 ect.
    Attached Files Attached Files
    Last edited by nightsurfer2004; 09-26-2011 at 02:43 PM. Reason: Sorted

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: sorting on lots of worksheets

    Have a go with the folder contents macro on my download page to generate a complete list of your files. If this works, it should be straightforward to create some extra code to extract the data from each one.

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: sorting on lots of worksheets

    Hi nightsurfer2004


    In your Invoice Template
    • Date is in Cell G8
    • Invoice Number is in Cell H10
    • Date Work Completed is in Cell H12
    Will this ALWAYS be true for ALL Invoices?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: sorting on lots of worksheets

    Assuming the parentfolder is "E:\parent"

    Please Login or Register  to view this content.
    Last edited by snb; 09-24-2011 at 07:18 AM.



  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: sorting on lots of worksheets

    Hi nightsurfer2004



    This code in the attached assumes this
    In your Invoice Template
    • Date is in Cell G8
    • Invoice Number is in Cell H10
    • Date Work Completed is in Cell H12
    and that this will ALWAYS be true for ALL Invoices. You'll need to change the line of code as indicated.
    Please Login or Register  to view this content.
    The code has been tested extensively...let me know of issues.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-15-2011
    Location
    Workington, Cumbria
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: sorting on lots of worksheets

    Cheers all - works a treat

+ 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