Run code based on cell contents

P

Pete JM

Hi,

I am stuck!!

Is there a piece of code that will allow a macro to run based on cel
contents.

For example i would like a piece of code to run and loop while th
value in cell A1 equals 1 But stop if the value equals 2.

Regards

Pet
 
P

Pete JM

Thank you that was really useful to know, but is there a way i can ge
the code to run without attaching it to a button.

So if i type 1 into cell A1 and press enter the macro wil
automatically run?

Regards

Pet
 
Top