If dt.Find("分类编号 = '" & s & Functions.Execute("数值转换2",n) & "'") Is Nothing Then dr("分类编号") = s & Functions.Execute("数值转换2",n) Exit For Else dr("分类编号") = s & Functions.Execute("数值转换2",n+1) End If
第一次找14001,没找到,执行else语句后面的代码(就是加粗的这行),将新增行的编号设置为14002,接下来找14002,自然就存在了。