Automatically Update a Cell for a Live Countdown

Summers2007

New Member
Joined
Dec 12, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I need help creating a countdown from $3,000,000 that auto updates every second to a lower number. I have the macro below that works for updating the sheet every second and it works. But I need the $3,000,000 to drop by $3.94 every second. Any ideas on a simple formula that will allow it to auto-update? Thanks in advance.

Sub CalculateNow()
'a5'
'i.e.
Calculate 'This recalculates all your cell values


Application.OnTime Now + TimeValue("00:00:01"), "CalculateNow"
End Sub
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
How about this ?
VBA Code:
Sub CalculateNow()
    'set A1=$3,000,000 before running the macro
    Range("A1") = Range("A1") - 3.94
    
    Application.OnTime Now + TimeValue("00:00:01"), "CalculateNow"
    
    If Range("A1") < 0 Then
        Application.OnTime Now + TimeValue("00:00:01"), "CalculateNow", Schedule:=False
        MsgBox "the end"
    End If
End Sub
 
Upvote 0
Solution
How about this ?
VBA Code:
Sub CalculateNow()
    'set A1=$3,000,000 before running the macro
    Range("A1") = Range("A1") - 3.94
   
    Application.OnTime Now + TimeValue("00:00:01"), "CalculateNow"
   
    If Range("A1") < 0 Then
        Application.OnTime Now + TimeValue("00:00:01"), "CalculateNow", Schedule:=False
        MsgBox "the end"
    End If
End Sub

Worked exactly as needed. Thank you.
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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