This isn't working for me. I am using your code in an example which
displays the time in a message box(I don't want it in a cell).
Start = Timer
For Count = 1 To 100000
Sheet1.Cells(1, 1) = "test"
Next Count
Start = (Timer - Start) / (60 * 60)
MsgBox Format(Start, "[hh]:mm:ss")
The msgbox shows :12:44. It should show 4 secs. What is wrong?
If you can forego some precision and work only in second, then use Timer
In the demo below I use Select to make an inefficient macro
Sub tryme()
Start = Timer
For j = 1 To 10000
Cells(j, 1).Select
Next j
Cells(1, 1).Select
Cells(1, 1) = (Timer - Start) / (60 * 60)
Selection.NumberFormat = "[hh]:mm:ss"
End Sub
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email
I would like to display the elapsed time a macro takes to run in minutes
& seconds. I only need seconds to be two places. How do I do this?