Thread: Not Looping
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Roger Roger is offline
external usenet poster
 
Posts: 226
Default Not Looping

Hello,

For testing purposes, I've entered identical columns in both Oldbook (r, 5)
and Filename (r, 1). Instead of looping through noted area (which has no
blanks), it just writes the cell contents of the very first entry from
Oldbook (1, 5) to Filename (1, 1) - should be writing all of them in each
cell because each have matches.

Any thoughts on how I can get this to evaluate the whole column by way of
looping? I'm looking for it to write any match contents the same way it does
with the very first entry.

Thanks - Roger


Sub NotLooping()

Dim r As Long
r = 1
Do While Not IsEmpty(Cells(r, 10))

If Workbooks(Oldbook).ActiveSheet.Cells(r, 5).Value = _
Workbooks(Filename).Sheets("Sheet1").Cells(r, 1).Value Then

Workbooks(Filename).Sheets("Sheet1").Cells(r, 3).Value =
Workbooks(Oldbook).Sheets("Checklist Log").Cells(r, 5).Value

End If
r = r + 1
Loop

'Workbooks(Filename).Close
Application.ScreenUpdating = True
End Sub