View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Formula/Macro Question

On Nov 11, 11:49*am, carl wrote:
My data table looks like this:

Router *Name
ABC * * QQQ
ABC * * SPY
ABC * * GOOG
EFG * * QQQ
EFG * * GOOG

I m trying to create this table:

Name * *Router
QQQ * * ABC,EFG
SPY * * ABC
GOOG * *ABC,EFG

Thanks in advance.


This does it
Sub lineemupSAS()Dim lr As LongDim lc As LongDim i As Mailer

Range("router").Copy Range("a1")lr = Cells(Rows.Count,
1).End(xlUp).RowColumns(2).CutColumns(1).InsertRan ge("A2:B" & lr).Sort
Key1:=Range("a2"), Order1:=xlAscending, _Header:=xlGuess,
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom* * *
**For i = lr To 1 Step -1If Cells(i + 1, 1) = Cells(i, 1) Then*lc =
Cells(i, Columns.Count).End(xlToLeft).Column + 1*Cells(i + 1, 2).Copy
Cells(i, lc)*Rows(i + 1).DeleteEnd IfNext iEnd Sub