Results 1 to 12 of 12

Sorting data in VBA

Threaded View

  1. #1
    Registered User
    Join Date
    03-14-2009
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Sorting data in VBA

    Hi All,

    I am encountering numerous problems compiling a macro to sort some pretty messy data. Hoping some of you could take a look and offer some suggestions....

    The Data I need sorting is shown in the 'DATARAW' worksheet, this comes in every day and shows positions for each traded period. Usually 48 periods which I have highlighted although the data download could somtimes consist of 46 or 50 periods.

    Sheet 1 (DATA RAW) contains data which I download daily.

    Sheet 2 (Data Sort) is how I need it to look after sorted (I only need the data in DATARAW replacing, not another worksheet creating).

    So for example:

    Where column A = SP8 and the adjacent column B = 1 I would need:

    All values which = ECN to concatenate the value in B to the reference in column B directly adjacent to the value next to it, until the folowing rows are presented:

    So for instance the first value reported would be 131964, second 131979 etc... until the following text is shown in the rows below

    IDD
    CAT
    ACE
    ACT
    ACE
    ACT


    When these appear I need the entire rows to be deleted.

    Then basically the same for the next period where SP8 appears in column A and 2 appears in Column B.

    also, the final result should contain no formulas so it can be referenced by lookups etc... also, all numeric colums should be stored as number so excel doesn't get confused.

    This will basically repeat itself until the end of the file showing the same split as aove but with ZZZ as a footer. Which I also need to delete. :-S

    IDD
    CAT
    ACE
    ACT
    ACE
    ACT
    ZZZ

    Rows containing the values below also need deleting.

    AAA
    NOH
    DSI
    AED


    I've used colours in the attachment but the actual file doesn't have any.

    Am sure this would be a simple macro for many of you but I am totally stumped, any help would be very much apprieciated.
    Attached Files Attached Files
    Last edited by Dr Mambo; 03-19-2009 at 05:29 AM. Reason: Missing Information

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