View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Greg[_41_] Greg[_41_] is offline
external usenet poster
 
Posts: 8
Default Modification of Recorded Macro

If I am in the wrong newsgroup I apologize. Maybe someone can direct me to
the correct group.

I have an excel workbook with one column of data on sheet 1. I have recorded
a Macro that moves certain data from sheet 1 to specified columns on sheet 2
of the workbook .

In some cases I needed to record several "find" i.e. EDIT-Find to locate on
sheet 1 the information I need to move to sheet 2.

My problem occurs certain months when the "find" does not locate the data I
am searching for. If I was doing this manually, I would set a default value
in the appropriate column of sheet 2 and continue.

However when my macro runs and encounters this situation I receive a runtime
error message and of course the Macro halts.

My question is can I :

1. Detect the runtime error before stopping execution of the Macro by
adding code to my Macro
2. Put a default value in the required column of sheet 2
3. Continue with the Macro at the point I received the runtime error

I am new at Macros and VBA.

Thank you in advance for your assistance.

Greg