Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a team listing in rows where it it says
1 2 3 a user1 Lead 1 Date1 b user2 Lead 1 Date1 c user3 Lead 2 Date1 d user4 Lead 3 Date1 e user5 Lead 2 Date1 f user6 Lead 1 Date1 How Can i change this so that it goes to 1 2 3 a Lead1 Lead2 Lead3 b user1 user3 User4 c user2 user5 d user6 e f The list continues on and on. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Public Sub ProcessData()
Dim iLastRow As Long Dim i As Long Dim iCol As Long Dim iRow As Long With ActiveSheet Worksheets.Add.Name = "__new" iLastRow = .Cells(.Rows.Count, "B").End(xlUp).Row For i = 1 To iLastRow iCol = 0 On Error Resume Next iCol = Application.Match(.Cells(i, "B").Value, _ Worksheets("__new").Rows(1), 0) On Error GoTo 0 If iCol = 0 Then iCol = Worksheets("__new").Range("A1").End(xlToRight).Col umn + 1 If iCol .Columns.Count Then iCol = IIf(Worksheets("__new").Range("A1").Value = "", 1, 2) End If Worksheets("__new").Cells(1, iCol).Value = .Cells(i, "B").Value iRow = 2 Else iRow = Worksheets("__new").Cells(1, iCol).End(xlDown).Row + 1 End If Worksheets("__new").Cells(iRow, iCol).Value = .Cells(i, "A").Value Next i End With End Sub -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "Sjakkie" wrote in message ... I have a team listing in rows where it it says 1 2 3 a user1 Lead 1 Date1 b user2 Lead 1 Date1 c user3 Lead 2 Date1 d user4 Lead 3 Date1 e user5 Lead 2 Date1 f user6 Lead 1 Date1 How Can i change this so that it goes to 1 2 3 a Lead1 Lead2 Lead3 b user1 user3 User4 c user2 user5 d user6 e f The list continues on and on. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
lock column size for some rows and resize for other rows. | Excel Discussion (Misc queries) | |||
printing issue - want to repeat two rows and also 5 rows in column | Excel Discussion (Misc queries) | |||
after selecting 50 rows of a column i can't reference the cells in the rows | New Users to Excel | |||
Pivot Table, Limit 255 rows, Invert rows and column | Excel Programming | |||
Need rows in Column A removed if they fully or partially match with any Column B row | Excel Discussion (Misc queries) |