View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Looping thorough records

Try playing around with this...
'------------------------
Sub GetRelOpt()
Dim x As Long
Dim NextRow As Long
Dim strToMatch
Dim rngCell As Excel.Range

NextRow = 1
Do While Cells(1 + NextRow, 1).Value < ""
x = 3
Set rngCell = Cells(NextRow, 1)
strToMatch = rngCell.Value
Do While Cells(1 + NextRow, 1).Value = strToMatch
rngCell(1, x).Value = Cells(1 + NextRow, 2).Value
NextRow = NextRow + 1
x = x + 1
Loop
NextRow = NextRow + 1
Loop
End Sub
'-----------
Jim Cone


"Debi H"
wrote in message
That got all of column B but put did put the field for column B when column A
changed
col A Col C
door 1234, 5555,5555,6666,1234
hood


There should be the matching records for door and the matching records for
door

col A Col C
door 1234, 5555
hood 5555,6666,1234


Does that make sense?