C
caricc
Can someone help I have gotten caught in an endless loop with the following
code:
Dim rngTarget As Range
Dim rngFound As Range
Dim intPasteRow As Integer
Set rngTarget = Sheets("PC Except Report Work").Cells
intPasteRow = Sheets("Final Docs
Report").Cells.SpecialCells(xlCellTypeLastCell).Row + 1
Set rngFound = rngTarget.Find("Final")
If Not rngFound Is Nothing Then
Do
rngFound.EntireRow.Copy Destination:=Sheets("Final Docs
Report").Cells(intPasteRow, 1)
intPasteRow = intPasteRow + 1
rngFound.EntireRow.Delete
Set rngFound = rngTarget.Find("Final")
Loop Until rngFound Is Nothing
In the Do section I just want to copy a row if a unique number called Loan
number does not exist on the final docs ws. I do not want teh delete. but if
I remove the delete it is caught in an endless loop.
Any help.
Thanks in advance.
code:
Dim rngTarget As Range
Dim rngFound As Range
Dim intPasteRow As Integer
Set rngTarget = Sheets("PC Except Report Work").Cells
intPasteRow = Sheets("Final Docs
Report").Cells.SpecialCells(xlCellTypeLastCell).Row + 1
Set rngFound = rngTarget.Find("Final")
If Not rngFound Is Nothing Then
Do
rngFound.EntireRow.Copy Destination:=Sheets("Final Docs
Report").Cells(intPasteRow, 1)
intPasteRow = intPasteRow + 1
rngFound.EntireRow.Delete
Set rngFound = rngTarget.Find("Final")
Loop Until rngFound Is Nothing
In the Do section I just want to copy a row if a unique number called Loan
number does not exist on the final docs ws. I do not want teh delete. but if
I remove the delete it is caught in an endless loop.
Any help.
Thanks in advance.