Excel Timer, save the file and disable it.

malekari

New Member
Joined
Jan 23, 2013
Messages
32
Hi,

I hope you're doing well.
I was looking if you could help me to create a macro with the below condition;

1) Start Timer (for 5 minutes) & the Stop Timer(seems to be not working, need help to make it work),
2) If the Stop Timer button is clicked, then the Start Timer button should be disabled or it cannot be re-started again.
3) Once the activity is completed in the following tabs, then after 5 minutes the tabs should be saved automatically & disable it from editing.

Below is the file that I've saved.

https://app.box.com/s/cvfqayp316smuvemxszox3l1hq9scovh

Thank you so much!

Regards,
Ivan
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi team,

Appreciate if someone can help me to edit/modify the code with the below conditions;

1) If the stop timer button is clicked then, the start button should be disabled,
2) After 5min, the workbook should be saved and the file should be disabled,

Looking forward for your reply..

Thank you,

Ivan M

Code:
Sub starttimer()Application.OnTime Now + TimeValue("00:00:01"), "nexttime"
End Sub




Sub nexttime()
If Sheet1.Range("b1") = 0 Then Exit Sub
Sheet1.Range("b1").Value = Sheet1.Range("b1").Value - TimeValue("00:00:01")


If Sheet1.Range("b1").Value <= TimeValue("00:02:00") Then
   Sheet1.Shapes("TextBox 2").Fill.ForeColor.RGB = RGB(255, 0, 0)
Else
   Sheet1.Shapes("TextBox 2").Fill.ForeColor.RGB = RGB(255, 255, 255)
End If


starttimer
End Sub




Sub stoptimer()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:01"), "nexttick", , False
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,571
Members
452,652
Latest member
eduedu

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