请大家帮帮忙啊!我非常感谢!!
大家有没有设计过这程序啊,比如这里有几组数据(123456,234567,345678,456789,123458,134589)如果和下面比方说四个数值相同时(3458),就把那数组拿掉,不用考虑位置这组数就是从小到大的
所以得出上面的还有(123456,234567,456789,)这三组,大家能不能帮我把这编出来啊
我非常感谢大家了!!
Private Sub Form_Click() Dim j As String, m As String Dim k() As String Dim i As Long, n As String Dim m2() As Byte Dim mj As Long Dim m3 As Long '输入源数据 j = InputBox("请输入一组数据,数字之间用半角逗号分隔", , "123456,234567,345678,456789,123458,134589,134567") If InStr(1, j, ",") > 0 Then '是正确数据后,输入过滤用的字符 m = InputBox("请输入要过滤的数字", , "13458") If Len(m) > 0 Then '数据转数组 m2 = StrConv(m, vbFromUnicode) k = Split(j, ",") '处理 For i = 0 To UBound(k) '这节是计算有几个字符符合 mj = 0 For m3 = 0 To UBound(m2) If InStr(1, k(i), Chr(m2(m3))) <> 0 Then mj = mj + 1 End If Next m3 If mj < 4 Then '这里是保留符合字符数的条件 n = n & "," & k(i) End If Next i n = Mid(n, 2) '输出结果 MsgBox "源数据:" & j & vbCrLf & "过滤数据:" & m & vbCrLf & "数据过滤后的结果是:" & vbCrLf & n '以下为错误提示 Else MsgBox "数据不对!", vbCritical End If Else MsgBox "数据不对,每个数字之间请用半角逗号分隔", vbCritical End If End Sub