Private Sub CommandButton1_Click()
Dim i As Integer
i = 3
While Not IsEmpty(ActiveSheet.Cells(i, 1).Value)
If ActiveSheet.Cells(i, 1).Value = TextBox1.Text Then
ActiveSheet.Cells(i, 1).Select
End If
i = i + 1
Wend
TextBox1.Text = ""
On Error Resume Next
TextBox1.SetFouce '一般用不着
End Sub
Dim i As Integer
i = 3
While Not IsEmpty(ActiveSheet.Cells(i, 1).Value)
If ActiveSheet.Cells(i, 1).Value = TextBox1.Text Then
ActiveSheet.Cells(i, 1).Select
End If
i = i + 1
Wend
TextBox1.Text = ""
On Error Resume Next
TextBox1.SetFouce '一般用不着
End Sub
Text1.SetFoucus OK!
Text1.Active
你出错的那行代码,是不是直接从程序中复制过来的?
如果是复制过来的,请先纠正拼写错误在调试看看
应是SetFoucus,而不是SetFouce