大神们,来帮帮我,双FOR循环怎么用啊
For k = pnCount + 1 To lc_num ’计算得到的多组数据(40多组数据,对应每组数据应该估算出一个对应的值)For Length1 = 1 To 8 Step 0.2 ’进行估算的循环
xsheet.Cells(k + 1, 9) = Length1
xsheet.Cells(k + 1, 10) = Lenght1 * Ratio.Text
xsheet.Cells(k + 1, 11) = Depth.Text
xsheet.Cells(k + 1, 12) = hight.Text
xsheet.Cells(k + 1, 13) = Density
xsheet.Cells(k + 1, 14) = Fak.Text
xsheet.Cells(k + 1, 15) = Length1 ^ 2 * Ratio.Text
xsheet.Cells(k + 1, 16) = xsheet.Cells(k + 1, 4) + Density * Depth.Text * xsheet.Cells(k + 1, 15)
xsheet.Cells(k + 1, 17) = Length1 ^ 3 * Ratio.Text ^ 2 / 6
xsheet.Cells(k + 1, 18) = Length1 ^ 3 * Ratio.Text / 6
xsheet.Cells(k + 1, 19) = xsheet.Cells(k + 1, 6) + hight.Text * xsheet.Cells(k + 1, 5)
xsheet.Cells(k + 1, 20) = xsheet.Cells(k + 1, 8) - hight.Text * xsheet.Cells(k + 1, 3)
xsheet.Cells(k + 1, 21) = xsheet.Cells(k + 1, 20) / xsheet.Cells(k + 1, 16)
xsheet.Cells(k + 1, 22) = xsheet.Cells(k + 1, 19) / xsheet.Cells(k + 1, 16)
xsheet.Cells(k + 1, 25) = xsheet.Cells(k + 1, 16) / xsheet.Cells(k + 1, 15)
xsheet.Cells(k + 1, 26) = xsheet.Cells(k + 1, 25) + Abs(xsheet.Cells(k + 1, 19)) / xsheet.Cells(k + 1, 17) + Abs(xsheet.Cells(k + 1, 20)) / xsheet.Cells(k + 1, 18) 'Pmax
If (xsheet.Cells(k + 1, 16) > 0) And (xsheet.Cells(k + 1, 25) < Fak.Text) And (xsheet.Cells(k + 1, 26) < Fak.Text * 1.2) Then ’跳出估算的条件(多条件),当满足条件时候跳出估算,进入下一组数据的估算
Exit For
End If
Next
Next
我现在遇到的问题是,对于一部分数据,估算值很理想,对于另一部分数据,就算内循环到底也跳不出来(实际上早已经满足条件,应该要跳出内循环的