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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,214,561
Messages
6,120,242
Members
448,951
Latest member
jennlynn

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