+ Reply to Thread
Results 1 to 6 of 6

vba to parse a large spreadsheet and only keep the most recent occurance column b

  1. #1
    Registered User
    Join Date
    02-16-2014
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    7

    vba to parse a large spreadsheet and only keep the most recent occurance column b

    i have some large reports that i get each day and have to sort into date time order and only keep the newest occurance based on column 2

    at the moment i have a vba that converts the list to space delimetd columns, then selects all sorts into date time order, then deletes dupliactes as of column 2 keeping the most recent,

    is there a more efficient way just to keep the most recent occurance and removing the rest

    example file. so the 2nd row would be what i am left with

    0 zztimrdevappg01 t bb zz 02/26/2014 19:04:30
    3 zztimrdevappg01 t bbb bb 02/27/2014 02:04:31
    8 zztimrdevappg01 hh bb zz 02/26/2014 19:04:32
    0 zztimrdevappg01 hh bb bb 02/26/2014 19:04:34

    many thanks

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: vba to parse a large spreadsheet and only keep the most recent occurance column b

    So if that data is space delimited and the data starts in column A, the date would be in column F and the time would be in column G. Couldn't you just sort by column F and G descending, then delete all but the first row?
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    02-16-2014
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: vba to parse a large spreadsheet and only keep the most recent occurance column b

    Hi thanks for your reply
    the file contains hundreds od different names in column 2 not just one like in the example

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: vba to parse a large spreadsheet and only keep the most recent occurance column b

    Do you get the data in a text file? When the macro starts, should it ask you which text file to import the data from? If so, give this a try:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-16-2014
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: vba to parse a large spreadsheet and only keep the most recent occurance column b

    hi
    The data is imported from outlook, then converetd from text to columns, then sorted as you have done by column b then colulmn f and g.
    i tried your code but unfortunately it froze up
    regards john.tm

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: vba to parse a large spreadsheet and only keep the most recent occurance column b

    I'd have to see a sample file. I can tell you that the code does work given the information I've been provided. It may just take awhile to run.

+ 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] Trying to parse data I need from large text files- SOLVED
    By d dubya in forum Excel General
    Replies: 8
    Last Post: 10-28-2012, 08:17 PM
  2. Replies: 3
    Last Post: 04-05-2011, 04:56 AM
  3. Determine LARGE with most recent data point excluded
    By mattmcg in forum Excel General
    Replies: 26
    Last Post: 09-25-2010, 04:04 AM
  4. Delete every nth Column from a very large spreadsheet
    By shmee150 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2009, 10:27 AM
  5. [SOLVED] how to increase a spreadsheet's column number from 256 to a large.
    By newcomer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2006, 08:20 PM

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