' 題名の行番号
Public Const ROW_NUMBER_TITLE = 1
' 着手完了の開始列番号
Public Const COLUMN_NUMBER_RESULT_START = 3
Sub ProcessManager(TagID As String, TimeStamp As String)
Dim column As Integer
column = COLUMN_NUMBER_RESULT_START
While (Cells(ROW_NUMBER_TITLE, column).Value <> "") And (Cells(ROW_NUMBER_TITLE, column + 2).Value <> "")
column = column + 3
Wend
Cells(ROW_NUMBER_TITLE, column).Value = "着手時刻"
Cells(ROW_NUMBER_TITLE, column + 1).Value = "完了時刻"
If Cells(ActiveCell.row, column).Value <> "" Then
Cells(ActiveCell.row, column + 1).Value = Time
Cells(ActiveCell.row, column + 2).FormulaR1C1 = "=RC[-1]-RC[-2]"
Cells(ROW_NUMBER_TITLE, column + 2).Value = "経過時間"
Else
Cells(ActiveCell.row, column).Value = Time
End If
End Sub