Hi,
I wrote the following code to perform an operation like... It should search the entire workbook and find the records matches with the given date (iDate_Key), also all the found rows should be copied to another sheet.
But when I am running the following code, only the first row (with the date match) is getting copied.
Please help...
________________________________
Sub Get_Row()
If Sheets(ws.Name).Cells(1, 2) = "CRDD" Then
rw_count = Sheets(ws.Name).Cells(Sheets(ws.Name).Rows.Count, 2).End(xlUp).Row
If rw_count > 1 Then
For i = 1 To rw_count1
Sheets(ws.Name).Activate
iDate_Key = CDate("9/12/2008")
Set rngFind = Cells.Find(What:=iDate_Key, After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, searchformat:=False)
If rngFind Is Nothing Then
Else
rngFind.EntireRow.Select
Selection.Copy
Sheet30.Select
lngNextRow = Range("A" & Rows.Count).End(xlUp).Row + 1
Range("A" & lngNextRow).PasteSpecial
Set rngFind = Nothing
End If
Next i
End If
End If
End Sub
Bookmarks