Pause Code with Modeless UserForm

Arthur494

New Member
Joined
May 21, 2008
Messages
29
I want my user to be able to check some boxes in a UserForm AND to edit some data in his sheet before the code continues.

According to the Show Form help "When a UserForm is modeless, subsequent code is executed as it's encountered." So, if I use a modeless form the code continues running without waiting for the user's input.

As far as I can see, the only way around this is to put "UserForm.Show vbModeless" as the last line in one macro and trigger the continuing code in a second macro from the form's own Private Sub cmdOK_click().

Is that right, please?

tia
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I want my user to be able to check some boxes in a UserForm AND to edit some data in his sheet before the code continues.

According to the Show Form help "When a UserForm is modeless, subsequent code is executed as it's encountered." So, if I use a modeless form the code continues running without waiting for the user's input.

As far as I can see, the only way around this is to put "UserForm.Show vbModeless" as the last line in one macro and trigger the continuing code in a second macro from the form's own Private Sub cmdOK_click().

Is that right, please?


tia

yes you can assign the subsequent code to a commandbutton on the modeless userform.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,458
Members
449,085
Latest member
ExcelError

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