I need a macro that will run numbers 0 threw to 20

Mathman

Board Regular
Joined
Jan 28, 2017
Messages
144
Office Version
  1. 2016
Platform
  1. Windows




Hi


I need a macro that will run numbers 0 threw to 20 in cell E1 sheet B0_Charts with 1 second intervals between each count and the macro ends once the number 20 is completed.


How would the macro look like?


Thank you
MM
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,348
Try
Code:
Sub Delay_Macro()
Const Delay_to_Wait      As Integer = 1
    Range("E1") = 0
    While (Range("E1") < 20)
        Application.Wait Now + TimeSerial(0, 0, Delay_to_Wait)
        Range("E1") = Range("E1") + 1
    Wend
    MsgBox "Job  Done"
'
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,108,974
Messages
5,525,991
Members
409,673
Latest member
Riseee

This Week's Hot Topics

Top