gene2 Posted March 19, 2007 Report Share Posted March 19, 2007 My name is Gene and guess what i'm rather new here My problem is that i have several macro to do my project and have them working fine. But in one i have the problem that i need to run 1 macro if condition is right. Then when macro is done i need it to run again if the next condition is right. But the macro just hangs up at the start of the second start of the macro. I have placed text boxes ahead of the second run of the macro in the if statement and the text boxes work in the right time but the macro hangs right there and won't go any farther. It seems like the first instance of the macro has not finished but yet the text box in the next if statement say i got back from my macro return statement but it just won't let go. If I place another macro in the same palce as this one it will work fine but it will not rerun the same macro. Any and ALL help would be appreiciated. Gene Quote Link to comment Share on other sites More sharing options...
johnboy691 Posted March 20, 2007 Report Share Posted March 20, 2007 Hi Gene, I'm John. See if I can give you a couple ideas here. I'm not sure exactly what you are trying to do, but I'll give it a stab. Put your main macro within Repeat statements. (Repeat Start, Repeat End). At the end of your macro after it's done doing what it normally does, but before it gets to the Repeat End, have it go and check what you need it to check to see if the next condition is right to have it run again. For example, does it need to check if it's at a certain place or position it needs to be on the screen, or can it check for something that can tell it it does need to repeat again. If you can copy this info into a variable and then use an IF statement you are halfway there. If the statement is not true have a repeat exit after the if and the key will stop. If it is true and the macro needs to run again have the macro do the steps it needs to do to get into position where the start of the macro needs to be to start over again and then have the repeat end. I have some macros that are over 6,000 lines long and has to check multiple times for conditions to continue, stop, or do something else. Good Luck! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.