Results 1 to 9 of 9

macro to delete rows and sort

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    665

    macro to delete rows and sort

    I have attached a worksheet to illustrate a "Before" (raw data) and "After" (desired results).

    Each row contains data on a forex trade. The variables which must be assessed in each row are:

    Currency Pair (e.g. GBP/USD).
    Opening Time
    Closing Time

    What I need to do is delete many rows in the raw data because they reflect a condition I do not want in my analysis, which is having multiple open trades of a single currency pair during the same time period.

    To perform my analysis I need to delete all trades (rows) which meet the above condition.

    The worksheet provides examples, along with a rudimentary tool I've used to help me sort/delete rows manually.

    Since I am looking at thousands of trades, a manual sort/delete is impractical. (my eyes don't like this kind of work!)

    The rudimentary tool I've used in manual sorts/deletes is simply to have a column which returns a "1" if a trade opens before an older trade has closed. I do this by first sorting the data by (a) currency pair then (b) date opened. Then I must manually go through multiple iterations of deleting trades until there all of the "1's" have disappeared.

    I'm hoping someone can show me a macro which might do this sorting/testing/deleting automatically, at least to the point where all I have to do is repeatedly press a "macro" button until there are no "1's"

    Thanks much for any help!
    Attached Files Attached Files
    Last edited by jrtaylor; 09-28-2009 at 05:08 PM.

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