View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Time consumption in macros

You want to use the timer something like this...

Dim lng As Long
Dim sngStartTime As Single
Dim sngEndTime As Single

sngStartTime = Timer
For lng = 1 To 1000000000 Step 1
Next lng
sngEndTime = Timer
MsgBox "Duration " & sngEndTime - sngStartTime
--
HTH...

Jim Thomlinson


"Jon" wrote:

Hi eveybody, here I am with one question:

How can I know the time which takes to Excel to execute a macro. Because I
have got some loops and I want to know how long does it take in order to view
if I can improve the loops or not.

Probably it is a simple question which I don't know and I think it is very
useful.

Thanks for your time!!!