如果有几百个 If ..... Then ........... ........... End If 在Command1超行数如何解决
如果有几百个:If ..... Then
...........
...........
End If
放在Command1下会因为行数太多无法通过,应当怎么处理?是否可以建个模块放在里边?
下面是报错提示:
[ 本帖最后由 益西翁登 于 2013-9-13 10:19 编辑 ]
Dim s1 As String Dim s2 As String Dim s3 As String Dim sL As Long Dim i As Long Dim fj() As String s1 = Combo1.Text & "," & Combo2.Text sL = Len(s1) Open "data.txt" For Input As #1 Do While EOF(1) Line Input #1, s2 s3 = Left(s2, sL) If s3 = s1 Then fj = Split(s2, ",") For i = 0 To 8 y(i).Caption = fj(i + 2) Next i Exit Do End If Close #1