+ Reply to Thread
Results 1 to 9 of 9

time/counter format

  1. #1
    Registered User
    Join Date
    02-17-2015
    Location
    Philippines
    MS-Off Ver
    2007
    Posts
    89

    time/counter format

    hi

    i am making a stopwatch. i would like milliseconds with it. for my macro, i use this code for the start button

    Sub StartTimer()
    nr = ThisWorkbook.Sheets("sheet1").Cells(Rows.Count, 1).End(xlUp).Row + 1
    Cells(nr, 1) = Time

    End Sub

    i thought if i changed the 'time' to mm:ss:000 it would work, but it doesnt.have i forgot to add something?

    thanks

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: time/counter format

    Time doesn't include milliseconds.

    Take a look at using Timer, it returns the no of seconds since midnight.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    02-17-2015
    Location
    Philippines
    MS-Off Ver
    2007
    Posts
    89

    Re: time/counter format

    im wanting to make a stopwatch. i have used Time as its the closest thing i can do that counts seconds. however, it's not really time that i want, just the seconds/milliseconds

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: time/counter format

    Timer returns seconds with a fraction part for milliseconds.

    It's often used to time code.

  5. #5
    Registered User
    Join Date
    02-17-2015
    Location
    Philippines
    MS-Off Ver
    2007
    Posts
    89

    Re: time/counter format

    so there is no simple way just to modify my code?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: time/counter format

    It's pretty straightforward to extract the milliseconds from Timer.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-17-2015
    Location
    Philippines
    MS-Off Ver
    2007
    Posts
    89

    Re: time/counter format

    is better yes thanks. but its still based around time, the first click goes to whatever second the clock is on rather than start at 0

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: time/counter format

    What exactly are you trying to do?

    When should the stopwatch start and when should it finish?

  9. #9
    Registered User
    Join Date
    02-17-2015
    Location
    Philippines
    MS-Off Ver
    2007
    Posts
    89

    Re: time/counter format

    there are 2 buttons on my sheet. this one, and a reset one. macro assigned for each.

    first time i press the 'start button' it should start from 0. each time i press the same button it keeps listing each time, so if press the button every second it will fill the A column with running figures.
    the next button i have code for is a 'reset button' which wipes all data from the A column so i can start from 0 again and repeat with the start button

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run-time error 1004 with column counter
    By GriffinCarpenter in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-30-2014, 10:05 AM
  2. Time Counter!
    By zks in forum Excel General
    Replies: 2
    Last Post: 01-20-2012, 01:33 PM
  3. Running counter using time
    By cdrum84 in forum Excel General
    Replies: 1
    Last Post: 06-06-2010, 11:47 AM
  4. Start/Stop Time counter
    By SVTF in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-19-2008, 07:38 PM
  5. [SOLVED] Automated Counter + 24 hour Time Difference.
    By all4excel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-27-2008, 02:15 PM

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