rubberband0
New Member
- Joined
- Jul 4, 2009
- Messages
- 15
Good morning,
I was wondering does anybody know of a way to get code to pause in place until a condition is met? Specifically, I want my code to bring up a modeless userform, but I want the code to pause at that spot in the procedure until the userform is unloaded (which is what seems to happen when I bring up a modal userform).
I've tried looking at using a boolean variable in order to control whether the code after the modeless userform is displayed gets executed. But, the code keeps running and just seems to skip over the parts where it does not have permission to execute. Since I have the code within a for-next loop, I don't want the code looping a bunch of times either
The general structure of my code is as follows:
For i = 1 to 52
If a < b then
userform.show vbModeless
--> Here is where I want to pause until the userform is unloaded <--
More code/instructions
End if
Next i
------------------------
Thanks for all your help!
Bests,
Richard
I was wondering does anybody know of a way to get code to pause in place until a condition is met? Specifically, I want my code to bring up a modeless userform, but I want the code to pause at that spot in the procedure until the userform is unloaded (which is what seems to happen when I bring up a modal userform).
I've tried looking at using a boolean variable in order to control whether the code after the modeless userform is displayed gets executed. But, the code keeps running and just seems to skip over the parts where it does not have permission to execute. Since I have the code within a for-next loop, I don't want the code looping a bunch of times either
The general structure of my code is as follows:
For i = 1 to 52
If a < b then
userform.show vbModeless
--> Here is where I want to pause until the userform is unloaded <--
More code/instructions
End if
Next i
------------------------
Thanks for all your help!
Bests,
Richard