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 thisThanks.
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
Bookmarks