+ Reply to Thread
Results 1 to 3 of 3

how do i add time to see how long my macro takes to run

  1. #1
    Registered User
    Join Date
    07-02-2005
    Posts
    53

    how do i add time to see how long my macro takes to run

    hi, my macro takes a few hours to run. i would like to add a function inside to measure the time taken. can anyone share how it's done? thanks.

  2. #2
    excelent
    Guest

    RE: how do i add time to see how long my macro takes to run

    try

    Sub test()
    x = Now()
    '
    ' ur kode
    '
    MsgBox ("Minute :") & Minute(Now() - x) & " Second :" & Second(Now() - x)
    End Sub




    "ernestgoh" skrev:

    >
    > hi, my macro takes a few hours to run. i would like to add a function
    > inside to measure the time taken. can anyone share how it's done?
    > thanks.
    >
    >
    > --
    > ernestgoh
    > ------------------------------------------------------------------------
    > ernestgoh's Profile: http://www.excelforum.com/member.php...o&userid=24870
    > View this thread: http://www.excelforum.com/showthread...hreadid=561815
    >
    >


  3. #3
    FSt1
    Guest

    RE: how do i add time to see how long my macro takes to run

    hi,
    there are a lot of ways to do this. here's one...

    Range("A1").Value = Time
    'YourMacro runs here
    Range("A2").Value = Time
    Range("A3").FormulaR1C1 = "=SUM(R[-1]C-R[-2]C)"
    Range("a1:a3").Select
    Selection.NumberFormat = "h:mm:ss"

    here's another

    Dim time1
    Dim time2
    Dim time3
    time1 = Time
    'YourMacro runs here
    time2 = Time
    time3 = time2 - time1
    MsgBox time3

    regards
    FSt1

    "ernestgoh" wrote:

    >
    > hi, my macro takes a few hours to run. i would like to add a function
    > inside to measure the time taken. can anyone share how it's done?
    > thanks.
    >
    >
    > --
    > ernestgoh
    > ------------------------------------------------------------------------
    > ernestgoh's Profile: http://www.excelforum.com/member.php...o&userid=24870
    > View this thread: http://www.excelforum.com/showthread...hreadid=561815
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1