akalehzan
03-23-2009, 07:36 PM
Hi All,
I have the following vba code searching for a specific field.
The problem is that if it does not find the field it errors out.
Is there a way to avoid showing the error in vba?:banghead:
Thanks in advance,
Abrahim
sub findtxt()
Worksheets("Sheet1").Activate
Cells.Find(What:="PatientsBirthDate", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(1, -1).Copy
end sub
I have the following vba code searching for a specific field.
The problem is that if it does not find the field it errors out.
Is there a way to avoid showing the error in vba?:banghead:
Thanks in advance,
Abrahim
sub findtxt()
Worksheets("Sheet1").Activate
Cells.Find(What:="PatientsBirthDate", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(1, -1).Copy
end sub