VB筛选工具
来源:百度知道 编辑:UC知道 时间:2024/07/05 13:19:39
加偶的QQ307477361 我给详细说明,有照片
代码如下:
Dim Recoard As String '记录信息读取
Dim StrLine() As String, Lines As Integer, Counts As Integer
Private Sub Command1_Click()
If Dir(App.Path & "\Msg.txt") <> "" Then ReadFile (App.Path & "\Msg.txt"): Recoard = ReadFile(App.Path & "\Msg.txt")
StrLine = Split(Recoard, vbCrLf)
If UBound(StrLine) > 0 Then
For Lines = 0 To UBound(StrLine) - 1
If StrLine(Lines) <> "" Then
If Text1.Text = StrLine(Lines) Then Counts = Counts + 1
End If
Next
End If
If Counts > 3 Then
If MsgBox("已经重复内容3次,还要重复吗?", vbYesNo, "选择你的决定") = vbYes Then
Open App.Path & "\Msg.txt" For Output As #1
Print #1, Recoard & Text1.Text
Close #1
End If
Else
Open App.Path & "\Msg.txt" For Output As #1
Print #1, Rec