VBA code for pause code in between while it is running

  • Dear Team,


    I am trying to create code for pause the progress in between while it is running.


    I have button which is for change test to ON and OFF. When my button is OFF once i pressed it it will change to ON and it should wait for 2sec and again it should change ON to OFF .


    For that my code is


    When ever i am running this code once i press the button after two second only it is executing the code and ON & OFF happening immediatly.


    Can any one tell me where the mistake on this code.

  • I truly do not understand what is happening withe the code as you have written it. Logic tells me it should work as desired .. but of course it does not.


    Experimenting around with different things, this is a work around to accomplish your goal, although it is not ideal as the your original code should work correctly.