如何在 D 列中找到 id,当发现将 g 列中的日期粘贴到 textbox17 中时

how to find id in column D, when found paste date from column g into textbox17

使用 userform1 在 d 列中搜索 ID,找到后从 g 列中获取 ID 日期并将日期粘贴到 textbox17 中...类似这样,但此代码无效。

 Private Sub CommandButton4_Click()
Dim id As String
Dim finalrow As Integer
Dim i As Integer

id = TextBox16.Value
finalrow = Sheets("ALL P.O. INFO").Range("D1000").End(xlUp).ROW

For i = 2 To finalrow
    If Cells(i, 4) = id Then
       Range(Cells(i, 7)).Copy
      TextBox17.Paste
    End If
Next i

End Sub
  {Private Sub CommandButton4_Click()
Dim id As String
Dim finalrow As Integer
Dim i As Integer

id = TextBox16.Value
finalrow = Sheets("ALL P.O. INFO").Range("D1000").End(xlUp).ROW

For i = 2 To finalrow
    If Cells(i, 4) = id Then
      Me.TextBox17 = Cells(i, 7).Value
    End If
Next i

End Sub}