Posted to microsoft.public.excel.programming
|
|
Find Function
Jim gave you a specific code example of how you might want to do it. If you
are happy with what you have and it works, then it is a matter of your
choice.
--
Regards,
Tom Ogilvy
"DejaVu" wrote in
message ...
Thanks for all the replies, but I found that function to be very fast
and efficient for what I need it for. After that function is done,
this is the bit of code that immediately follows it:
Worksheets("Sheet1").Range("J1").Select
Set rngSls = Range("J1", Selection.End(xlDown))
For Each tmpRng In rngSls
If ActiveCell.Value = "Sales" Then
Do Until ActiveCell.Value < "Sales"
i = ActiveCell.Row
Cells(i, 10).EntireRow.Delete
Loop
End If
ActiveCell.Offset(1, 0).Select
Next
This code works perfectly for deleting the rows from Sheet1 after the
function has copied them to Sheet2. If I was not specific enough, I'm
sorry for the confusion. My only question was: Is there a way to use
that existing function (from my link above) to make it delete the rows
out of Sheet1 that it has copied to Sheet2?
Here is what I used to call the function and have it copy rows to
Sheet2:
Find_Range("Sales", Columns("J"), xlFormulas, xlWhole).EntireRow.Copy
Range("Sheet2!A2")
Everything works fine now, so I dont know whether I should change or
not, but I wanted to know if this was the "best" way to accomplish this
task.
Thanks,
DejaVu
--
DejaVu
------------------------------------------------------------------------
DejaVu's Profile:
http://www.excelforum.com/member.php...o&userid=22629
View this thread: http://www.excelforum.com/showthread...hreadid=385313
|