Results 1 to 6 of 6

Thread: Macro to Sort 4 days data, Keep Sequential Data and Delete rest

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    Aug 2013
    Posts
    59
    Rep Power
    12

    Macro to Sort 4 days data, Keep Sequential Data and Delete rest

    I currently use Excel Version 2003 (It is okay, even if macro is for Excel2007)

    Data Range A:O

    Row data could differ from 2,000 to 6,000 rows (having 4 days data)

    Column O has Date Data in format dd-mmm-yy

    All data in its current form is arranged in Ascending order, based on Date Data in Column O

    I need a VBA Macro Procedure that could-

    1) Sort Data in Column A:O,
    first on Column B, then sort on
    Column D, then sort on
    Column O, then sort on
    Column C
    2) Above would line up 4 days dataset based on date, but few record could be for less than 4 days, say, only for 1st, 2nd and 3rd days, but not for 4th day, or for 1st,3rd,and 4th day, but not for 2nd day and so on, which should be deleted, as each record set should be for 4 days, in continuity. Shortly, Each data should be for minimum 4 days, if not, entire row should be deleted.

    For Clarity purpose in attached workbook having sample data,
    a) Sheet1 (Named as - RAWDATA) - Contains RAW data
    b) Sheet2 (Named as - Sorted on B D O C) shows, how data should be organised after sorting per criteria given in 1) above,
    c) Sheet2 (Named as - Sorted on B D O C) Highlighted rows in Grey Color shows where data is not for 4 days sequentially, and hence such row should be deleted
    d) Sheet3 (Output) Final Output data is given, just for sample basis, each data set for 4 days, arranged sequentially.

    Data in Sheet3 is just sample output, done manually currently, so restricted till rows 72

    Macro should process and bring the desired data in Sheet1 itself, where raw data was residing originally.
    Attached Files Attached Files

Similar Threads

  1. Replies: 10
    Last Post: 02-18-2014, 01:34 PM
  2. Replies: 6
    Last Post: 08-14-2013, 04:25 PM
  3. Replies: 6
    Last Post: 05-10-2013, 01:13 AM
  4. Excel Macro to Sort Data if a value changes in defined range
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 4
    Last Post: 09-05-2012, 10:31 AM
  5. Sort Data When a Header Is Clicked
    By Rasm in forum Excel Help
    Replies: 9
    Last Post: 08-01-2012, 06:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •