新手求助对比时遇到空值时出错
Dim v1, v2Dim l&, m&
v1 = Split(Text1.Text, vbCrLf)
v2 = Split(Text2.Text, vbCrLf)
l = IIf(UBound(v1) > UBound(v2), UBound(v1), UBound(v2))
For m = LBound(v1) To l
If CStr(v1(m)) <> CStr(v2(m)) Then Text3.Text = Text3.Text & v1(m) & vbCrLf
Next m
End Sub
对比时遇到空值时会错误,新手请教处理方法:
如:
text1内容
1
2
3
text2内容
1
2
提示越界