Results 1 to 4 of 4

Need an amendment in a macro which records system time.

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-01-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    128

    Need an amendment in a macro which records system time.

    Hello,

    I have a macro which I intended for mapping the time.

    So when I click on start button, it should give me - hh/mm/ss & same for stop button.

    For time taken column, I need it in mm/ss format and below in total I need it hh/mm/ss.

    Also am not sure why when I click start and stop - time taken column doesnt show the exact seconds it took.

    Havent added the macro in the file as I dont know why the file size was getting above par. Please I need some help on this Thanks.

    Macro I used :

    Option Explicit

    Private Sub cmdStart1_Click()
    cmdStart1.Enabled = False
    cmdStop1.Enabled = True
    WriteTime 1, True
    End Sub

    Private Sub cmdStop1_Click()
    cmdStop1.Enabled = False
    cmdStart1.Enabled = True
    WriteTime 1, False
    End Sub

    Private Sub WriteTime(line As Integer, Start As Boolean)
    Dim lngRowStart As Long, lngColStart As Integer
    Dim lngRow As Long

    Select Case line
    Case 1, 2, 3
    lngRowStart = 19
    Case 4, 5, 6
    lngRowStart = 40
    End Select
    Select Case line
    Case 1, 4
    lngColStart = 2
    Case 2, 5
    lngColStart = 9
    Case 3, 6
    lngColStart = 16
    End Select

    If Not Start Then lngColStart = lngColStart + 1

    With ThisWorkbook.Worksheets("Time Map")
    If .Cells(lngRowStart, lngColStart).Value = vbNullString Then
    lngRow = .Cells(lngRowStart, lngColStart).End(xlUp).Row + 1
    Else
    Exit Sub
    'lngRow = lngRowStart
    End If
    .Cells(lngRow, lngColStart).Value2 = Format(Now(), "hh:mm:ss")
    End With

    End Sub
    Attached Files Attached Files
    Last edited by Raju Radhakrishnan; 08-18-2013 at 02:38 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. XMLl file - Mapping / Schema questions
    By Scott K in forum Excel General
    Replies: 0
    Last Post: 07-19-2013, 07:46 PM
  2. Need help to tweak a macro so that it will format a plain csv file into a nice table
    By BrandonFromSingapore in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2012, 06:06 AM
  3. Import File To Outlook From Excel With Mapping
    By jaslake in forum Outlook Programming / VBA / Macros
    Replies: 7
    Last Post: 02-03-2011, 07:48 AM
  4. Tweak Macro to show 'on time' Departures.
    By rushdenx1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2010, 05:40 AM
  5. Parsing imported TXT file but like a tweak...
    By MBCMDR in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-05-2009, 11:20 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