+ Reply to Thread
Results 1 to 8 of 8

Extracting data from a range that changes daily based on a cells criteria

  1. #1
    Forum Contributor
    Join Date
    04-25-2011
    Location
    Donegal, Ireland
    MS-Off Ver
    Excel 2013
    Posts
    133

    Extracting data from a range that changes daily based on a cells criteria

    Hi, Everyday i receive an .xlsx file online.

    Once downloaded I have to extract specific areas of data from the file to a particular worksheet in another workbook.

    The source file has titles for ranges within the file which are constant but the rows of data beneath these titles vary on a daily basis.

    I am looking for a macro that will extract a range of data below a particular title.

    e.g. In the attached file (test sheet.xlsx) i want to extract A65-C122 into the worksheet 'new' in test sheet.xlsm (see attached).

    The range I've specified changes daily but the text in the titles stay the same albeit moved to different rows, daily also.

    I have spent the entire day trying to find a way using the Match function as recommended by 'nathansav', but my head is scrambled now at this stage.

    Any help would be a huge load off.

    Regards
    John
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Extracting data from a range that changes daily based on a cells criteria

    match is not the right funtion for what you are trying to do.

    Try this code:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-25-2011
    Location
    Donegal, Ireland
    MS-Off Ver
    Excel 2013
    Posts
    133

    Re: Extracting data from a range that changes daily based on a cells criteria

    Hi mehmetcik, Thanks for your response. This looks really close to what I need.

    The thing is, I need to run this macro from worksheet 'new' in the 'test sheet.xlsm' workbook. So it will need go to workbook 'test sheet.xlsx', retrieve the data within the parameters you have set out and paste it back into 'test sheet.xlsm' workbook on the 'new' worksheet.

    If this is this possible.

    Thanks again

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Extracting data from a range that changes daily based on a cells criteria

    This is only a minor change.

    Your code becomes:-

    Note I have added a couple of lines to move any existing rows in sheet new down by the number of lines that you are copying.
    This will stop it over writing your existing data. The lines are easily identified and deleted if you don't want them.

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

  5. #5
    Forum Contributor
    Join Date
    04-25-2011
    Location
    Donegal, Ireland
    MS-Off Ver
    Excel 2013
    Posts
    133

    Re: Extracting data from a range that changes daily based on a cells criteria

    mehmetcik, this worked perfectly, exactly what i was looking for.

    Many many thanks

    John
    Last edited by JohnnyBoyxxx; 07-11-2014 at 03:35 PM. Reason: typo

  6. #6
    Forum Contributor
    Join Date
    04-25-2011
    Location
    Donegal, Ireland
    MS-Off Ver
    Excel 2013
    Posts
    133

    Re: Extracting data from a range that changes daily based on a cells criteria

    Hi mehmetcik, Is there a way to repeat the code to select additional data using the same formula but with different start and end rows, and then add it to the 'new' sheet at the first free blank cell in column A

    Regards
    John

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Extracting data from a range that changes daily based on a cells criteria

    Easily done.

    Original range was A65-C122

    What is the new range

  8. #8
    Forum Contributor
    Join Date
    04-25-2011
    Location
    Donegal, Ireland
    MS-Off Ver
    Excel 2013
    Posts
    133

    Re: Extracting data from a range that changes daily based on a cells criteria

    Additionally i would like to include in the final results the section below row 132 'Windows 7 Grade A Refurbished Notebooks & Netbooks 1 Year Warranty' and above row 176 'Acer Vista / XP Notebooks – Refurbished 1 Year Warranty - Upgrade any notebook to Windows 7 for £29 + Vat'. So the range is A131-C175

    Thx Mehmetcik

+ 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. Daily Pivot Filter based on Date range specified in cells
    By swicked in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2012, 01:23 AM
  2. [SOLVED] #NUM! Error with Extracting Data Based on Criteria
    By ACM2 in forum Excel General
    Replies: 15
    Last Post: 06-28-2012, 02:38 PM
  3. Replies: 2
    Last Post: 11-19-2010, 07:49 AM
  4. Help Extracting Data Based On two Criteria
    By chadha.hitesh in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-09-2010, 11:08 AM
  5. Extracting Data Based on Criteria
    By SJT in forum Excel General
    Replies: 3
    Last Post: 06-16-2007, 04:18 PM

Tags for this Thread

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