Transpose cells
Hello,
This macro worked for me. It will go down the entire column of data in column A and build a list in column B (and others as necessary). Once the list is complete, column A is deleted.
Hope this helps,
Ben
Sub TransposeIt()
Dim rList As Range
Dim lCol As Long
Dim lRow As Long
Dim c As Range
Set rList = Range("A1:" & Range("A" & Rows.Count).End(xlUp).Address)
lCol = 1
lRow = 1
For Each c In rList
If lCol = 1 Then
lCol = lCol + 1
ElseIf Left(c.Value, 10) = Left(c.Offset(-1, 0).Value, 10) Then
lCol = lCol + 1
Else
lCol = 2
lRow = lRow + 1
End If
Cells(lRow, lCol).Value = c.Value
Next c
Range("a1").EntireColumn.Delete
ActiveSheet.UsedRange.EntireColumn.AutoFit
Set rList = Nothing
End Sub
|