View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default macro to run only under certain condition - how?

Norbert,

One way to do it would be to add a test at the start of the button code that
tests whether the condition has already been met, and exit if true.

I cannot be more specific than that as I do not know what your button code
looks like, or how you determine that the dataeset has already been added,
but you should know that.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Orion" wrote in message
...
I've written some code and assigned it to a command button (not the
ActiveX one), which works fine.
It adds a new dataset to a database, once the new information entered
is not part of the database yet.

Is there any way to disable the macro from running, once this newly
entered information is already stored in the database?

Basically I need some code for this:

If G6="not defined yet" then run the macro code
otherwise not

Thanks for your help!

Norbert