Results 1 to 5 of 5

Rows to colums

Threaded View

  1. #1
    Registered User
    Join Date
    08-11-2009
    Location
    Amsterdam
    MS-Off Ver
    Excel 2007
    Posts
    5

    Rows to colums

    I have a sheet with products and information regarding these products.
    It is consistently build up in a 5-row information block per product like:

    A1: name
    A2: info
    A3: price
    A4: to be deleted
    A5: to be deleted

    What I want:

    A1: name
    B1: description
    C1: Price

    For product 2 it should:
    A6 -> A2
    A7 -> B2
    A8 -> C2
    A9 -> to be deleted
    A10 -> to be deleted ..etcetera

    The Macro should loop until no data is found in the A column. Note: some of the 2nd rows (information) are not filled. They can't be deleted but need to be left empty!

    Any chance?


    Edit: Recording a macro for the first 2 products gives this:

    Selection.Cut
        ActiveCell.Offset(0, 1).Range("A1").Select
        ActiveSheet.Paste
        ActiveCell.Offset(1, -1).Range("A1").Select
        Selection.Cut
        ActiveCell.Offset(-1, 2).Range("A1").Select
        ActiveSheet.Paste
        ActiveCell.Offset(2, -2).Range("A1").Select
        Selection.Cut
        ActiveCell.Offset(-2, 3).Range("A1").Select
        ActiveSheet.Paste
        ActiveCell.Offset(5, -3).Range("A1").Select
        Selection.Cut
        ActiveCell.Offset(0, 1).Range("A1").Select
        ActiveSheet.Paste
        ActiveCell.Offset(1, -1).Range("A1").Select
        Selection.Cut
        ActiveCell.Offset(-1, 2).Range("A1").Select
        ActiveSheet.Paste
        ActiveCell.Offset(2, -2).Range("A1").Select
        Selection.Cut
        ActiveCell.Offset(-2, 3).Range("A1").Select
        ActiveSheet.Paste
        ActiveCell.Offset(5, -3).Range("A1").Select
    End Sub
    Only I want it to continue throughout the whole document....
    Last edited by Cheetah; 08-12-2009 at 12:44 AM.

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