ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Timing VBA code (https://www.excelbanter.com/excel-programming/371454-timing-vba-code.html)

Steve M

Timing VBA code
 
I have a VBA routine that may take a considerable amount of time to execute
(~20minutes). I would like to have the code time itself and record the value
in a workbook to allow other future users to know how long the routine is
likely to take. Has anyone done this? Any ideas on how to proceed?

Thanks,
Steve

Gary''s Student

Timing VBA code
 
v1=Time
do lots of stuff
v2=Time
Msgbox(v2-v1)
--
Gary's Student


"Steve M" wrote:

I have a VBA routine that may take a considerable amount of time to execute
(~20minutes). I would like to have the code time itself and record the value
in a workbook to allow other future users to know how long the routine is
likely to take. Has anyone done this? Any ideas on how to proceed?

Thanks,
Steve


Die_Another_Day

Timing VBA code
 
Var1 = Now()
'Your Code
Range("A1") = Now() - Var1

Charles

Steve M wrote:
I have a VBA routine that may take a considerable amount of time to execute
(~20minutes). I would like to have the code time itself and record the value
in a workbook to allow other future users to know how long the routine is
likely to take. Has anyone done this? Any ideas on how to proceed?

Thanks,
Steve




All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com