Not Looping

R

Roger

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top