ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Not Looping (https://www.excelbanter.com/excel-discussion-misc-queries/177916-not-looping.html)

Roger

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


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com