+ Reply to Thread
Results 1 to 4 of 4

Transpose data to columns from rows keeping unique data together

Hybrid View

  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    36

    Transpose data to columns from rows keeping unique data together

    So basically i have one single column with groups of information in it, each bit of info is separated by a space (1 row). I need a macro to move this info into 3 columns, keeping the matching information together in a row...

    have attached an example of what i mean since i probably make no sense

    thanks!Macro example.xlsx

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Transpose data to columns from rows keeping unique data together

    Alter if needed.
    Sub test()
        Dim i As Long
        For i = 1 To Columns(1).SpecialCells(2).Areas.Count
            With Columns(1).SpecialCells(2).Areas(i)
                Cells(i, 3).Resize(, .Rows.Count).Value = _
                Application.Transpose(.Value)
            End With
        Next
        Cells(1, 5).Resize(i - 1).NumberFormat = "0"
        Columns("c:e").AutoFit
    End Sub

  3. #3
    Registered User
    Join Date
    08-21-2013
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    36

    Re: Transpose data to columns from rows keeping unique data together

    awesome! that worked perfectly thank you

    if you don't mind, could you quickly explain how this macro works? i may have similar data later but with slight changes so might need to alter it if i can

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Transpose data to columns from rows keeping unique data together

    1)
    Columns(1).SpecialCells(2).Areas
    This gives you the areas(block of range) that has constant values. 2 = xlConstants.
    You will see the range adding one line
    MsgBox Columns(1).SpecialCells(2).Areas.Address
    2) Loop thrugh 1) and output each range to other range transposing column to row(s).

    Any question?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How can I transpose my data keeping a unique ID
    By frankyy72 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2013, 09:32 PM
  2. Duplicate rows, delete columns w/same data, combine columns w/unique data, Mac Excel 2011
    By msmcoin in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 02-03-2013, 02:10 PM
  3. [SOLVED] Transpose Rows to Columns but Keeping Data in Blocks
    By james_ross in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2013, 09:00 AM
  4. Transpose columns of data in rows
    By Absar in forum Excel General
    Replies: 4
    Last Post: 09-14-2010, 09:10 PM
  5. Replies: 3
    Last Post: 02-12-2009, 02:54 PM

Tags for this Thread

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