参考这个
Private Sub Command1_Click()
Dim objTest As Object
Dim strT1 As String
Dim strT2 As String
strT1 = Text1.Text
strT2 = Time
For Each objTest In Form1
If objTest.Name = strT1 Then
w ByVal objTest, strT2
Exit For
End If
Next
End Sub
Private Function w(ByVal l As Object, l2 As String)
l.Caption = l2
End Function