やりたいことが今一つわからないので憶測です。
Sub 入力()
Dim c As Range
For Each c In Range(\u0026quot;C7\u0026quot;, \u0026quot;D7\u0026quot;)
If Trim(c) = \u0026quot;\u0026quot; Then
MsgBox c.Address(0, 0) \u0026amp; \u0026quot; が未入力です。入力してください。\u0026quot;, vbExclamation
Exit Sub
End If
Next c
Dim x As Variant, targetName As String, inputDate As Date
targetName = Range(\u0026quot;D7\u0026quot;).Value
inputDate = Range(\u0026quot;C7\u0026quot;).Value
x = Application.Match(Range(\u0026quot;D7\u0026quot;), Range(\u0026quot;G7:G1000\u0026quot;), 0)
If IsError(x) Then
MsgBox \u0026quot;名前:\u0026quot; \u0026amp; Range(\u0026quot;D7\u0026quot;) \u0026amp; \u0026quot; は一覧にありません\u0026quot;, vbCritical
Exit Sub
End If
Dim nextRow As Long
Cells(x + 6, \u0026quot;I\u0026quot;) = inputDate
Cells(x + 6, \u0026quot;H\u0026quot;) = Cells(x + 6, \u0026quot;H\u0026quot;) + 1
With Worksheets(\u0026quot;履歴シート\u0026quot;)
nextRow = .Cells(Rows.Count, \u0026quot;B\u0026quot;).End(xlUp).Row + 1
.Cells(nextRow, \u0026quot;B\u0026quot;) = targetName
.Cells(nextRow, \u0026quot;C\u0026quot;) = inputDate
.Cells(nextRow, \u0026quot;B\u0026quot;).Resize(, 2).Borders.LineStyle = True
End With
MsgBox \u0026quot;更新が完了しました\u0026quot;, vbInformation
End Sub