Hi All
Is there any problem in the code?? When I run it then continue running and doesn't stop. WHy?/
[code]
lastrow = ws.Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To lastrow
strsql = "select * from Jabberwocky where Batchno=" & ws.Cells(i, 1).Value & ""
rs.Open strsql, cn
If Not (rs.BOF = True And rs.EOF = True) Then
ws.Cells(i, 2).Value = rs.Fields("Policyno").Value
End If
rs.Close
Next i
[code]
Bookmarks