Private Sub CommandButton1_Click() Dim rng As Range Set rng = Sheet1.Range("B:B").Find(TextBox1.Text) If Not rng Is Nothing Then For i = 1 To 4 Me.Controls("Label" & i + 5).Caption = rng.Offset(, i).Value Next End If End Sub
Private Sub CommandButton1_Click() Dim rng As Range Set rng = Sheet1.Range("B:B").Find(TextBox1.Text) If Not rng Is Nothing Then For i = 1 To 4 Me.Controls("Label" & i + 5).Caption = rng.Offset(, i).Value Next End If End Sub
以下是引用紫猪侠在2010-4-10 19:00:00的发言: Private Sub CommandButton1_Click() Dim rng As Range Set rng = Sheet1.Range("B:B").Find(TextBox1.Text) If Not rng Is Nothing Then For i = 1 To 4 Me.Controls("Label" & i + 5).Caption = rng.Offset(, i).Value Next End If End Sub