'Why does this code not stop after 10 Seconds
'I am now doing as suggested this does not stop
'after 10 secs
Sub test()
Application.OnTime Now + TimeValue("00:00:08"), "TerminateExecution"
ChangeDoubleToDate
End Sub
Sub TerminateExecution()
End
End Sub
Sub ChangeDoubleToDate()
Dim ii As Long
Sheets.Add
ActiveSheet.Name = "Example"
Range("A:E").ColumnWidth = 15
Range("A:E").ClearContents
Range("A1").Select
For ii = 20190101 To 20191234
ActiveCell.Value = ii
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-1],1,4)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-2],5,2)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-3],7,2)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=DATE(RC[-3],RC[-2],RC[-1])"
ActiveCell.Offset(1, -4).Range("A1").Select
DoEvents
Next
Application.DisplayAlerts = False
Sheets("Example").Delete
Application.DisplayAlerts = True
End Sub
Friday, 23 August 2019
vba - How to Automatically stop a Sub running after 10 seconds
Subscribe to:
Post Comments (Atom)
php - file_get_contents shows unexpected output while reading a file
I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...
-
I have an app which needs a login and a registration with SQLite. I have the database and a user can login and register. But i would like th...
-
I got an error in my Java program. I think this happens because of the constructor is not intialized properly. My Base class Program public ...
-
I would like to use enhanced REP MOVSB (ERMSB) to get a high bandwidth for a custom memcpy . ERMSB was introduced with the Ivy Bridge micro...
No comments:
Post a Comment