+ Reply to Thread
Results 1 to 3 of 3

Sorting Data Colums

  1. #1
    Jez
    Guest

    Sorting Data Colums

    Hi,

    I am trying to merge data from rows into 1.

    4195-0000 10046000932 10 The Street, Any Town, Big City, PC1
    2PC 08 11/04/2005


    Carcass CARCASS - Fire Open FLAVEL WELCOME G/F - UnitHtr R/S BAXI
    BRAZILIA2 SLIMLINE - UnitHtr R/S MAXOL MONTANA 1500

    6290-0001 10046000665 119 The Street, Any Town, Big City, PC1
    2PC 08 13/04/2005


    Carcass CARCASS

    4314-0000 10046000924 12 The Street, Any Town, Big City, PC1
    2PC 08 12/04/2005


    Carcass CARCASS

    4403-0000 10046000711 127 The Street, Any Town, Big City, PC1
    2PC 08 13/04/2005

    I am wanting to take the line that starts with Carcass and put it at the end
    of the line with the address.

    Please help and let me know how its possible??

    Much appreciated,

    Jez.

  2. #2
    Toppers
    Guest

    RE: Sorting Data Colums

    Jez,
    Try this which assumes lines are "paired" i.e last row is a
    "Carcass" row. Carcass rows are deleted after adding to previous row ... so
    test first!

    Change ranges to suit as I have had to interpret what is in each column.

    Sub a()
    lastrow = Cells(Rows.Count, "A").End(xlUp).Row
    For r = lastrow To 2 Step -2
    'add columns A to C (of "Carcass") to end of previous row (assumed to be
    column F)
    Range("a" & r & ":c" & r).Copy Range("G" & r - 1)
    Rows(r).Delete ' Delete Carcass row
    Next r
    End Sub


    HTH

    "Jez" wrote:

    > Hi,
    >
    > I am trying to merge data from rows into 1.
    >
    > 4195-0000 10046000932 10 The Street, Any Town, Big City, PC1
    > 2PC 08 11/04/2005
    >
    >
    > Carcass CARCASS - Fire Open FLAVEL WELCOME G/F - UnitHtr R/S BAXI
    > BRAZILIA2 SLIMLINE - UnitHtr R/S MAXOL MONTANA 1500
    >
    > 6290-0001 10046000665 119 The Street, Any Town, Big City, PC1
    > 2PC 08 13/04/2005
    >
    >
    > Carcass CARCASS
    >
    > 4314-0000 10046000924 12 The Street, Any Town, Big City, PC1
    > 2PC 08 12/04/2005
    >
    >
    > Carcass CARCASS
    >
    > 4403-0000 10046000711 127 The Street, Any Town, Big City, PC1
    > 2PC 08 13/04/2005
    >
    > I am wanting to take the line that starts with Carcass and put it at the end
    > of the line with the address.
    >
    > Please help and let me know how its possible??
    >
    > Much appreciated,
    >
    > Jez.


  3. #3
    Jez
    Guest

    RE: Sorting Data Colums

    Toppers, Thanks for that.

    I am still struggling with this.

    This below is how it set out in Excel. I am wanting to take the information
    which in the first set of data is in Cell A4 and move up 3 rows and paste in
    to what would be in Column I but for this case it would be Cell I1. This
    would carry on down the page till I reach around row 2000, also the problem
    is that it may not be 2 blank rows between address and carcass row. This is
    changeable

    (Cell A1)4195-0000 (Cell C1)10046000932(Cell D1)10 The Street, Any Town,
    Big City, PC1 2PC (Cell G1)08(Cell H1)11/04/2005

    (Cell A4)Carcass CARCASS - Fire Open FLAVEL WELCOME G/F - UnitHtr
    R/S BAXIBRAZILIA2 SLIMLINE - UnitHtr R/S MAXOL MONTANA 1500

    I hope this is easier to explain what I am doing. I am taring my hair out
    with it now :-)

    If its easier I could email a example file for you to look at. please let me
    know.

    Thanks,
    Jez


    "Toppers" wrote:

    > Jez,
    > Try this which assumes lines are "paired" i.e last row is a
    > "Carcass" row. Carcass rows are deleted after adding to previous row ... so
    > test first!
    >
    > Change ranges to suit as I have had to interpret what is in each column.
    >
    > Sub a()
    > lastrow = Cells(Rows.Count, "A").End(xlUp).Row
    > For r = lastrow To 2 Step -2
    > 'add columns A to C (of "Carcass") to end of previous row (assumed to be
    > column F)
    > Range("a" & r & ":c" & r).Copy Range("G" & r - 1)
    > Rows(r).Delete ' Delete Carcass row
    > Next r
    > End Sub
    >
    >
    > HTH
    >
    > "Jez" wrote:
    >
    > > Hi,
    > >
    > > I am trying to merge data from rows into 1.
    > >
    > > 4195-0000 10046000932 10 The Street, Any Town, Big City, PC1
    > > 2PC 08 11/04/2005
    > >
    > >
    > > Carcass CARCASS - Fire Open FLAVEL WELCOME G/F - UnitHtr R/S BAXI
    > > BRAZILIA2 SLIMLINE - UnitHtr R/S MAXOL MONTANA 1500
    > >
    > > 6290-0001 10046000665 119 The Street, Any Town, Big City, PC1
    > > 2PC 08 13/04/2005
    > >
    > >
    > > Carcass CARCASS
    > >
    > > 4314-0000 10046000924 12 The Street, Any Town, Big City, PC1
    > > 2PC 08 12/04/2005
    > >
    > >
    > > Carcass CARCASS
    > >
    > > 4403-0000 10046000711 127 The Street, Any Town, Big City, PC1
    > > 2PC 08 13/04/2005
    > >
    > > I am wanting to take the line that starts with Carcass and put it at the end
    > > of the line with the address.
    > >
    > > Please help and let me know how its possible??
    > >
    > > Much appreciated,
    > >
    > > Jez.


+ 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