View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Ken Macksey Ken Macksey is offline
external usenet poster
 
Posts: 77
Default Get time it takes to run program!!

Hi

Sorry about that. It works fine if you remove some of the dims like this.

Dim totaltime As Long



starttime = Now()


'Your code here



Endtime = Now()

totaltime = DateDiff("s", starttime, endtime)

'convert seconds into minutes and seconds to display
Mins = Int(totaltime \ 60)
Secs = totaltime Mod 60

Totaltimetaken = Mins & " Minute(s) and " & secs & " Seconds."

MsgBox(Totaltimetaken)



HTH

Ken