randomize cycle and time useform

mramoxia

New Member
Joined
Jun 1, 2016
Messages
18
Hi,

I've got the following code to randomize through userforms, however I would like it to loop through on a random time frame from 5 minutes to 15 minutes and show for 5 seconds then close.

So just say I click the button to start the macro, it shows a random userform for 5 seconds then closes, then in say 8 minutes it brings up another userform for 5 seconds then closes and so on..

Code:
Sub TestMe2()Randomize
UserForms.Add "UserForm" & (Int(5 * Rnd) + 1)
UserForms(UserForms.Count - 1).Show


End Sub

Cheers
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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