+ Reply to Thread
Results 1 to 7 of 7

Moving data from columns to rows

  1. #1
    Registered User
    Join Date
    09-24-2009
    Location
    Norwich, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Moving data from columns to rows

    Ok, a faily simple problem that I can't quite get my wee little brain around.

    I have the following spreadsheet with 4 columns of data:

    1000001 245 a Mr Fred Blogs
    1000001 270 a 1 Blog Street
    1000001 270 b Norwich
    1000001 270 c Norfolk
    1000001 270 e NRx x99
    1000001 270 g The Manager
    1000001 270 k 01603 555 555
    1000001 270 l 01603 555 555
    1000001 270 q Manager
    1000001 270 x N
    1000001 270 y N
    1000002 245 a Mrs Fredilina blogs
    1000002 270 a 10 Blog Street
    1000002 270 b Norwich
    etc etc for about 36,000 rows.

    What I need is for each unigue reference ID (column A), I need all corresponding data moved up into a single row in serperate columns, something like this:

    1000001 |245| a| Mr Fred Blogs| 270|a| 1 Blog Street|270|b| Norwich | 270|b|Norfolk |etc
    1000002 |245 |a |Mrs Fredina Blogs |270|a|10 Blog Street |270|b|Norwich| etc

    Each entry doesn't nessesarily have the same number of rows.

    I would class myself as a beginner VBA bod, but the solution to this one is illuding me a present.

    Hope this all makes sense.

    Any ideas gratefully recieved.

    Ben
    Last edited by brittben17; 09-24-2009 at 11:04 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Moving data from columns to rows

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-24-2009
    Location
    Norwich, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Moving data from columns to rows

    Indeed! - A good idea.

    Please find attached workbook which will hopefully describe a little easier what I am looking for.

    Cheers,

    Ben
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Moving data from columns to rows

    Here is one approach:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-24-2009
    Location
    Norwich, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Moving data from columns to rows

    Thanks Stephen..

    I am getting '424' Object required pop-ups with
    Please Login or Register  to view this content.
    highligted by the debugger....

    Any thoughts?

    Ben

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Moving data from columns to rows

    Ben - it worked for your example, but perhaps your actual file is different. Try using sheet names, e.g. replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-24-2009
    Location
    Norwich, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Thumbs up Re: Moving data from columns to rows

    Stephen,

    You are a star - many thanks for this - I'll enjoy unpicking the code to work out whats going on, but otherwise, top job!


    Regards,

    Ben

+ 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