Thread: A Simple Timer
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jay Fincannon Jay Fincannon is offline
external usenet poster
 
Posts: 23
Default A Simple Timer

That's exactamundo. How would I ever know about Lib "kernel32"() ?


On Thu, 20 Nov 2003 08:13:42 -0600, "Chip Pearson"
wrote:

Jay,

Try something like

Private Declare Function GetTickCount Lib "kernel32" () As Long

Private Sub Worksheet_Change(ByVal Target As Range)
Dim StartTick As Long
Dim EndTick As Long
StartTick = GetTickCount()
'
' your code here
'
EndTick = GetTickCount()
MsgBox "Elapsed time (milliseconds): " & _
Format(EndTick - StartTick, "#,##0")
End Sub