+ Reply to Thread
Results 1 to 4 of 4

Need an amendment in a macro which records system time.

  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.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,962

    Re: Need to tweak the file... For time mapping

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.


    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Last edited by protonLeah; 08-18-2013 at 08:07 PM.
    Ben Van Johnson

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,962

    Re: Need an amendment in a macro which records system time.

    This solution was deleted. Looking over your past posts, it seems like you are using this forum to do your work for you; and because you continue to flaunt the rules regarding titles and code tags.
    Last edited by protonLeah; 08-18-2013 at 08:04 PM.

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

    Re: Need an amendment in a macro which records system time.

    I am stuck with some codes due to which I asked for help..and there are some experts in this forum who can help due to which I post these questions... I dont know why you feel like you mentioned above.

+ 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. 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