Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Rows to column

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Rows to column

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
lock column size for some rows and resize for other rows. Gorskim Excel Discussion (Misc queries) 1 November 20th 07 11:12 PM
printing issue - want to repeat two rows and also 5 rows in column cliffykat Excel Discussion (Misc queries) 0 August 29th 07 10:36 PM
after selecting 50 rows of a column i can't reference the cells in the rows Bob Salzer New Users to Excel 2 July 21st 06 10:29 PM
Pivot Table, Limit 255 rows, Invert rows and column xav Excel Programming 3 December 29th 05 02:01 PM
Need rows in Column A removed if they fully or partially match with any Column B row [email protected] Excel Discussion (Misc queries) 1 August 21st 05 11:41 PM


All times are GMT +1. The time now is 10:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"