View Single Post
Old 01-20-2011, 08:53 PM   #20
Mad Mel
First Line Centre
 
Mad Mel's Avatar
 
Join Date: Mar 2009
Location: Brisbane, Australia
Exp:
Default

Or you could just run a VBA macro.

Code:
Public Sub TransposeColumnToMultipleColumns()

    MaximumNewRows = 50         'Maximum number of rows in output
    NewColumn = 3               'First column used in output
    
    'Loop through rows of first column
    For Each RowObj In ActiveSheet.Rows
    
        'Exit when it hits a blank cell
        CellValue = RowObj.Cells(1, 1)
        If CellValue = "" Then Exit For
        
        'Put the value into it's new location
        NewRow = RowObj.Row Mod MaximumNewRows
        If NewRow = 0 Then NewRow = MaximumNewRows
        ActiveSheet.Cells(NewRow, NewColumn) = CellValue
        
        'Move to the next column when the maximum number of rows is reached
        If NewRow = MaximumNewRows Then NewColumn = NewColumn + 1
                
    Next RowObj
    
End Sub
Mad Mel is offline   Reply With Quote