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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,224,814
Messages
6,181,121
Members
453,021
Latest member
Justyna P

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