写一个函数:
Private Sub chazhao(ByVal dj As Integer)
Dim chu As Integer
chu = InStr(dj, RichTextBox1.Text, sfind) '比较两个字符串得到一个初始位置
If chu > 0 Then
ab = chu ‘ab是全局变量,用不用这步都没事
RichTextBox1.SelectionStart = ab - 1 ‘就是哪个位置开始选
RichTextBox1.SelectionLength = Len(sfind)‘选中要查找的字符串
Else
MsgBox("没有找到!!!")
sfind = InputBox("请输入要查找 的内容:", "查找内容", sfind)
End If