Hi,
Assign the result of the Find to an object and remove the Activate method.
If the item is not found the Activate will cause an error.
The help file has example code, select Find and press F1.
Cheers
Andy
--
Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Vinita" <(E-Mail Removed)> wrote in message
news:FD590980-BD4C-444F-BC22-(E-Mail Removed)...
> Hi,
> I am writing a macro in an MPP.The macro runs fine for the first
> time.But
> the next time its run its popping up an Error.But again after clicking
> the
> "Reset" button in the VB Editor the code works fine again.
>
> Is there any way that I can "Reset" in the code itself?So that it will
> work
> fine the next time its run.
>
>
> In Debug mode, Im getting "Run time Error 1004 Method Cells of object
> '_Global' failed at the following line of code.
> Cells.Find(what:=subtask_name, lookat:=xlWhole,
> searchDirection:=xlNext).Activate
>
>
>
> Thanks in advance,
> Vinita