Pause VBA Code until userform command button is clicked

JeffGrant

Well-known Member
Joined
Apr 7, 2021
Messages
516
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I set my userforms up to be Modal. No Drama.
On the userforms is usually a couple of command buttons.

Until recently, the vba code would pause until a command button is clicked.

The userform is shown via a called sub.

But this week, I find that the vba code continues without waiting for a command button to be clicked.

Do I need to add some code to make sure that the code pauses until a command button is clicked?

I see that there are several discussions about this using wait and sleep and Do Untils etc, but the solutions all seem far more complicated than what it needs to be.

I think I am missing the obvious solution.

Any direction would be greatly appreciated. Thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Thanks Skyboy. Problem solved. I was calling and incorrect sub. was difficult to find. but i got :)
 
Upvote 0
Solution

Forum statistics

Threads
1,215,096
Messages
6,123,074
Members
449,093
Latest member
ripvw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top