...来了百度hi我 - -
***
Private Sub Command1_Click()
Dim x As String
Dim js As String
Dim n(100) As Long
Dim a(100) As String
x = Text2
n(0) = InStr(1, x, Text1)
If n(0) > 0 Then
a(0) = Mid(x, 1, n(0) - 1) & CStr(1) & "." & Text1
y = a(0)
For i = 1 To 100
n(i) = InStr(n(i - 1) + 1, x, Text1)
If n(i) > 0 Then
a(i) = Mid(x, n(i - 1) + 1, n(i) - n(i - 1) - 1) & CStr(i + 1) & "." & Text1
y = y & a(i)
Else
js = Right(x, Len(x) - n(i - 1))
y = y & js
Exit For
End If
Next i
End If
Text2 = y
End Sub
*******
''看下面, 这回完全按照你的要求了 - -!
''text1输入关键字,点按钮后,text2就会打印出你想要的东东啦!
''对了 - - 别把text1跟text2又搞反了!!
''还有,下面的C:\1.txt是你的文件路径...你根据情况自己改!
Private Sub Command1_Click()
Dim x As String
Dim n As Integer
Dim s(100) As String
Open "C:\1.txt" For Input As #1
'''''''************这里的C:\1.txt修改成你的文件地址
Do While Not EOF(1)
Line Input #1, s(i)
n = n + 1
i = i + 1
DoEvents
Loop
Close #1
For i = 1 To n
If InStr(1, s(i), Text1) > 0 Then
s(i - 1) = CStr(i / 2 + 0.5) & "." & s(i - 1)
x = x & s(i - 1) & vbCrLf & s(i) & vbCrLf
End If
Next i
Text2 = x
End Sub
温馨提示:答案为网友推荐,仅供参考