Alex,
Dos this help
Dim sSave As String
Windows("10.txt").Activate
sSave = ActiveCell.Address
On Error Resume Next
Cells.Find(WHAT:="DDCE", _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False).Activate
On Error GoTo 0
If ActiveCell.Address < sSave Then
ActiveCell.Offset(rowOffset:=0, columnOffset:=5).Activate
Selection.Copy
Windows("DAILY OPERATIONS_2004.xls").Activate
Range("E18").Select
ActiveSheet.Paste
Windows("10.txt").Activate
Cells.Find(WHAT:="EXT", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
ActiveCell.Offset(rowOffset:=0, columnOffset:=4).Activate
Selection.Copy
Windows("DAILY OPERATIONS_2004.xls").Activate
Range("J18").Select
ActiveSheet.Paste
End If
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"alexm999 " wrote in message
...
Im running a simple Find macro to populate cells from another file. The
problem im having is when the term im finding is not there, my macro
breaks and stops... Is there a way i can bypass or do something that
will jump to the next find if the first find was not found?
Here's my Code:
Windows("10.txt").Activate
Cells.Find(WHAT:="DDCE", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
ActiveCell.Offset(rowOffset:=0, columnOffset:=5).Activate
Selection.Copy
Windows("DAILY OPERATIONS_2004.xls").Activate
Range("E18").Select
ActiveSheet.Paste
Windows("10.txt").Activate
Cells.Find(WHAT:="EXT", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
ActiveCell.Offset(rowOffset:=0, columnOffset:=4).Activate
Selection.Copy
Windows("DAILY OPERATIONS_2004.xls").Activate
Range("J18").Select
ActiveSheet.Paste
---
Message posted from http://www.ExcelForum.com/