This is the macro that was created on the sheet "T&M". How do I modify it to copy to another sheet in the same workbook?
Sub Intialize()
Dim iRow As Long
iRow = Sheets("T&M").Range("H" & Application.Rows.Count).End(xlUp).Row + 1
'Code to Validate
If Sheets("T&M").Range("F" & iRow).Value = "" Then
Sheets("T&M").Range("B" & iRow).Value = Format([Today()], "DD-MMM-YYYY")
Sheets("T&M").Range("C" & iRow).Value = Application.UserName
End If
End Sub
Sub Start_Time()
Dim iRow As Long
iRow = Sheets("T&M").Range("H" & Application.Rows.Count).End(xlUp).Row + 1
'Code to Validate
If Sheets("T&M").Range("D" & iRow).Value = "" Then
MsgBox "Please select the Task Name from the drop down.", vbOKOnly + vbInformation, "Task Name Blank"
Sheets("T&M").Range("D" & iRow).Select
Exit Sub
ElseIf Sheets("T&M").Range("F" & iRow).Value <> "" Then
MsgBox "Start Time is aleady captured for the selected Task."
Exit Sub
Else
Sheets("T&M").Range("F" & iRow).Value = [Now()]
Sheets("T&M").Range("F" & iRow).NumberFormat = "hh:mm:ss AM/PM"
End If
End Sub
Sub End_Time()
Dim iRow As Long
iRow = Sheets("T&M").Range("H" & Application.Rows.Count).End(xlUp).Row + 1
'Code to Validate
If Sheets("T&M").Range("F" & iRow).Value = "" Then
MsgBox "Start Time has not been captured for this task."
Exit Sub
Else
Sheets("T&M").Range("G" & iRow).Value = [Now()]
Sheets("T&M").Range("G" & iRow).NumberFormat = "hh:mm:ss AM/PM"
Sheets("T&M").Range("H" & iRow).Value = Sheets("T&M").Range("G" & iRow).Value - Sheets("T&M").Range("F" & iRow).Value
Sheets("T&M").Range("H" & iRow).NumberFormat = "hh:mm:ss"
End If
'Fill the Date and Name in next row
Call Intialize
End Sub