+ Reply to Thread
Results 1 to 7 of 7

Checking mulitple parts of array for same values and latest date

  1. #1
    Registered User
    Join Date
    02-01-2015
    Location
    Melbourne
    MS-Off Ver
    2010
    Posts
    3

    Checking mulitple parts of array for same values and latest date

    Hi,

    I'm reading in a csv file through a macro and coping it into a worksheet.

    But as I read this file in, I'd like to check three columns within the array (I've named them here as Task_ID, Forecast_Date, and Status), to see if the row I'm reading in has the same values for these fields, and then a more recent "DATE" field. So I'm actually interested in four fields (but only to check if three of them are the same and then the last one is different).

    So as I read this data:

    ID Date User Project_PM Project ID Task_ID Task_ID_Bid Task Name Melb_Net Other_Net Other_Sub_Net Disbursements Forecast Date Task_Forecast_Amount Task_Forecast_Time Status Percentage Comment
    1 1/02/2014 9:00 RC RC P114011 1 1.1 First task 200 100 100 1/02/2014 200 2 Forecast 1
    2 1/02/2014 9:00 RC RC P114011 2 1.2 Second task 200 100 100 1/02/2014 200 4 Forecast 1
    3 1/02/2014 9:00 RC RC P114011 3 1.3 Third task 200 100 100 1/02/2014 200 16 Forecast 1
    4 1/02/2014 9:00 RC RC P114011 4 1.4 Fourth task 200 100 100 1/03/2014 200 12 Forecast 1
    5 1/02/2014 9:00 RC RC P114011 5 1.5 Fifth task 200 100 100 1/03/2014 200 22 Forecast 1
    6 1/02/2014 9:00 RC RC P114011 6 1.6 Sixth task 200 100 100 10 1/03/2014 200 4 Forecast 1
    7 2/02/2014 9:00 RC RC P114011 1 1.1 First task 200 100 100 1/02/2014 200 12 Forecast 0.5
    8 2/02/2014 9:00 RC RC P114011 1 1.1 First task 200 100 100 1/03/2015 200 12 Forecast 0.5



    I'd like the actual worksheet to only be populated with this data:

    ID Date User Project_PM Project ID Task_ID Task_ID_Bid Task Name Melb_Net Other_Net Other_Sub_Net Disbursements Forecast Date Task_Forecast_Amount Task_Forecast_Time Status Percentage Comment
    2 1/02/2014 9:00 RC RC P114011 2 1.2 Second task 200 100 100 1/02/2014 200 4 Forecast 1
    3 1/02/2014 9:00 RC RC P114011 3 1.3 Third task 200 100 100 1/02/2014 200 16 Forecast 1
    4 1/02/2014 9:00 RC RC P114011 4 1.4 Fourth task 200 100 100 1/03/2014 200 12 Forecast 1
    5 1/02/2014 9:00 RC RC P114011 5 1.5 Fifth task 200 100 100 1/03/2014 200 22 Forecast 1
    6 1/02/2014 9:00 RC RC P114011 6 1.6 Sixth task 200 100 100 10 1/03/2014 200 4 Forecast 1
    7 2/02/2014 9:00 RC RC P114011 1 1.1 First task 200 100 100 1/02/2014 200 12 Forecast 0.5
    8 2/02/2014 9:00 RC RC P114011 1 1.1 First task 200 100 100 1/03/2015 200 12 Forecast 0.5


    I have used the open csv data vba script from here: http://stackoverflow.com/questions/9...ba-performance

    I'm assuming that the check of data is inserted around the section that has:

    For i = 1 To locNumRows
    For j = 0 To UBound(locLinesList(i), 1)
    locData(i, j + 1) = locLinesList(i)(j)
    Next j
    Next i


    Thanks for you help!

    Rob

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Checking mulitple parts of array for same values and latest date


    Hi,

    join a xlsx file with before and after macro worksheets and a csv file …

    Also crystal clear explain the criteria to not import a line !

    _________________________________________________________
    Je suis Charlie

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

    Re: Checking mulitple parts of array for same values and latest date

    r_catchlove

    Can you upload a .csv(.txt) file?
    Your data is not correctly delimited. (Tab delimited?)

  4. #4
    Registered User
    Join Date
    02-01-2015
    Location
    Melbourne
    MS-Off Ver
    2010
    Posts
    3

    Re: Checking mulitple parts of array for same values and latest date

    test_data.csv

    Attached is the data.

    And sorry I didn't quite understand the other comment about using a macro before.

  5. #5
    Registered User
    Join Date
    02-01-2015
    Location
    Melbourne
    MS-Off Ver
    2010
    Posts
    3

    Re: Checking mulitple parts of array for same values and latest date

    Should be formatted correctly - 19 columns. Some don't have data of course so there are commas with no spaces or characters in between.

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

    Re: Checking mulitple parts of array for same values and latest date

    deleted...............
    Last edited by jindon; 02-02-2015 at 02:17 AM.

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

    Re: Checking mulitple parts of array for same values and latest date

    OOps, Should be this one
    Please Login or Register  to view this content.

+ 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] Return latest date Part repair information from an array
    By Martin Chamberlin in forum Excel General
    Replies: 2
    Last Post: 05-15-2014, 10:13 PM
  2. [SOLVED] Return an array which changes according to latest date in heading at the top of table
    By David Brown in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-21-2013, 07:16 AM
  3. [SOLVED] Latest date within a conditional array...!!!
    By pavan210 in forum Excel General
    Replies: 12
    Last Post: 04-26-2012, 03:12 PM
  4. Retrieve latest value from mulitple columns
    By paulcc in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-06-2008, 11:20 AM
  5. return mulitple values from array dbase
    By J.Jones in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-20-2005, 08:39 AM

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