+ Reply to Thread
Results 1 to 3 of 3

Sorting Data

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    171

    Sorting Data

    I have data in following format (this is just an extract, there are 600 rows
    under headings A-F)

    A
    J1
    J2
    J3

    B
    J77
    J65
    J31

    C
    J22
    J11
    J9

    ........
    So I have cost Centres, A -F ( these can be in any order), with Job numbers
    below(always prefixed by J), there can be any number of Job numbers.




    I need to get the above into the order:


    J1 A
    J2 A
    J3 A


    J77 B
    J65 B
    J31 B


    J22 C
    J11 C
    J9 C

    Many Thanks

  2. #2
    Tom Ogilvy
    Guest

    Re: Sorting Data

    Sub ABC()
    Dim rng as Range, cell as Range, ar as Range
    set rng = Columns(1).SpecialCells(xlConstants)
    for each ar in rng.Areas
    for each cell in ar
    if cell.row <> ar(1).Row then
    cell.offset(0,1).Value = ar(1).Value
    end if
    next cell
    ar(1).ClearContents
    next ar
    End Sub


    --
    Regards,
    Tom Ogilvy

    "T De Villiers" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I have data in following format (this is just an extract, there are 600
    > rows
    > under headings A-F)
    >
    > A
    > J1
    > J2
    > J3
    >
    > B
    > J77
    > J65
    > J31
    >
    > C
    > J22
    > J11
    > J9
    >
    > .......
    > So I have cost Centres, A -F ( these can be in any order), with Job
    > numbers
    > below(always prefixed by J), there can be any number of Job numbers.
    >
    >
    >
    >
    > I need to get the above into the order:
    >
    >
    > J1 A
    > J2 A
    > J3 A
    >
    >
    > J77 B
    > J65 B
    > J31 B
    >
    >
    > J22 C
    > J11 C
    > J9 C
    >
    > Many Thanks
    >
    >
    > --
    > T De Villiers
    > ------------------------------------------------------------------------
    > T De Villiers's Profile:
    > http://www.excelforum.com/member.php...o&userid=26479
    > View this thread: http://www.excelforum.com/showthread...hreadid=566317
    >




  3. #3
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    171
    Thanks Tom, that works a treat

+ Reply to Thread

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