View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Debi H Debi H is offline
external usenet poster
 
Posts: 16
Default Looping thorough records

one thing I noticed......I have data in column 3-6 for that 2nd row as well
and when it takes the data and merges it from column 2 (B) it deletes the
other date in columns 3-6. I gues I need to merge that data as well??? And
as you will notice the last column may or maynot have data.


BRAKE LINE RUBBING, KNOCKING 4 BT93 LY52486 8888
BRAKE LINE RUBBING, KNOCKING 4 BU31 LT91873 2807
DOOR INNER HANDLE FUNCTION 4 BU33 LW59323 1130
DOOR CUT-OUT WELD ISSUE 4 DU91 LK43454
FOG REARLIGHT FUNCTION 4 DU52 LF68094 1130



"Jim Cone" wrote:

Sub GetRelOpt()
Dim lngR As Long
Dim varToMatch As Variant
Dim rngCell As Excel.Range
Dim rngColumn As Excel.Range

Set rngColumn = Range("A1", Cells(Rows.Count, 1).End(xlUp))
For Each rngCell In rngColumn
If Len(rngCell.Value) Then
varToMatch = rngCell.Value
lngR = 2
Do While rngCell(lngR, 1).Value = varToMatch
rngCell(1, 2).Value = rngCell(1, 2).Value & ", " & rngCell(lngR, 2).Value
rngCell(lngR, 2).EntireRow.Clear
lngR = lngR + 1
Loop
End If
Next
rngColumn.EntireRow.Sort key1:=Range("A1")
End Sub
'------------


"Debi H"
wrote in message
It still did not work and pick up the hood and put the data in the cell in
the B column that related to the hood. Also it put it in 3 different cells
not one