Private Sub Command1_Click()
Dim N As Long
N = Val(Text5.Text)
Dim J As Long
For J = 1 To N
Dim I As Long
Dim S As String
Dim T2 As Long
Dim T3 As Long
For I = 0 To 5
If Check1(I).Value = 1 Then
Dim IPN As Variant
Dim IPS() As String
IPS = Split(Text2(I).Text, ".")
IPN = Val(IPS(0)) * 256 * 256 * 256
IPN = IPN + Val(IPS(1)) * 256 * 256
IPN = IPN + Val(IPS(2)) * 256
IPN = IPN + Val(IPS(3))
IPN = IPN + Val(Text3(I).Text) * (J - 1)
IPS(0) = Int(((IPN / 256) / 256) / 256)
IPN = IPM - Val(IPS(0)) * 256 * 256 * 256
IPN(1) = IPN \ 65536
IPN = IPN Mod 65536
IPS(2) = IPN \ 256
IPN(3) = IPN Mod 256
S = Replace(Text1(I).Text, "(*)", IPS(0) & "." & IPS(1) & "." & IPS(2) & "." & IPS(3))
Else
T2 = Val(Text2(I).Text)
T3 = Val(Text3(I).Text)
T2 = T2 + T3 * (J - 1)
S = Replace(Text1(I).Text, "(*)", T2)
End If
Text4.Text = Text4.Text & vbCrLf & S
Next I
Next J
End Sub
IPN = IPN + Val(IPS(1)) * 256 * 256 下标越界 怎么处理啊