'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, August 23, 2019
vba - How to Automatically stop a Sub running after 10 seconds
Subscribe to:
Post Comments (Atom)
hard drive - Leaving bad sectors in unformatted partition?
Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...
-
My webapp have javascript errors in ios safari private browsing: JavaScript:error undefined QUOTA_EXCEEDED_ERR:DOM Exception 22:An...
-
I would like to use the jquery autocomplete function on a field of a form collection. For example, I have a form collection that got those f...
-
Current setup Microsoft Deployment Toolkit (MDT) 2013 Update 1 (recently released version) All images done from Windows 10 Enterprise machin...
No comments:
Post a Comment