VB循环do loop语句变换使用! 如图,这是一个计算的程序!我想实现的是当时间不连续时,比如7月7号的23点和7月8号的12点,要想使12点对应的数据等于我设定的室内温度数据,比如29℃,而不是跟前面计算过的数据相关联的,就不如上面的2个表格中的数,左边的是不连续时间的数值受上一时刻计算的数值的影响,右边的则是不收影响,重新等于一个数(这里设的是比28.28小2度),想实现右边的这种功能应该如何实现? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Private Sub Command5_Click() Do While Not Adodc6.Recordset.EOF j = 2 + 60 * n Do Until i = j If Val(Text29.text) - Val(Combo6.text) > 3 Then If Abs(Val(Text53.text) - Val(Text102.text)) > 1 And Abs(Val(Text53.text) - Val(Text102.text)) <> 23 Then Do Until Val(Text29.text) - Val(Combo6.text) < 1 Text92.text = Val(Text80.text) Text93.text = Val(Text84.text) * Val(Text92.text) ^ 2 + Val(Text85.text) * Val(Text92.text) + Val(Text96.text) Text94.text = Val(Text86.text) * Val(Text92.text) + Val(Text87.text) newsheet.Cells(i, 1).Value = Text97.text newsheet.Cells(i, 2).Value = Text53.text newsheet.Cells(i, 3).Value = Text28.text newsheet.Cells(i, 4).Value = Text29.text newsheet.Cells(i, 5).Value = Text26.text newsheet.Cells(i, 6).Value = Text93.text newsheet.Cells(i, 7).Value = Text94.text newsheet.Cells(i, 8).Value = Text98.text newsheet.Cells(i, 9).Value = Text99.text newsheet.Cells(i, 10).Value = Text100.text newsheet.Cells(i, 11).Value = Fix(Text92.text + 0.5) Text29.text = Val(Text29.text) - (Val(Text93.text) - Val(Text26.text)) * 60 / (Text1(0).text * Text1(1).text * Text1(2).text * 1.2 * 1000 + 100000) Text98.text = Val(Text93.text) / 60000 + Val(Text98.text) Text99.text = Val(Text94.text) / 60000 + Val(Text99.text) Text100.text = Val(Text98.text) / Val(Text99.text) i = i + 1 Text92.text = Val(Text81.text) Loop End If Text92.text = Val(Text80.text) Text93.text = Val(Text84.text) * Val(Text92.text) ^ 2 + Val(Text85.text) * Val(Text92.text) + Val(Text96.text) Text94.text = Val(Text86.text) * Val(Text92.text) + Val(Text87.text) newsheet.Cells(i, 1).Value = Text97.text newsheet.Cells(i, 2).Value = Text53.text newsheet.Cells(i, 3).Value = Text28.text newsheet.Cells(i, 4).Value = Text29.text newsheet.Cells(i, 5).Value = Text26.text newsheet.Cells(i, 6).Value = Text93.text newsheet.Cells(i, 7).Value = Text94.text newsheet.Cells(i, 8).Value = Text98.text newsheet.Cells(i, 9).Value = Text99.text newsheet.Cells(i, 10).Value = Text100.text newsheet.Cells(i, 11).Value = Fix(Text92.text + 0.5) Text29.text = Val(Text29.text) - (Val(Text93.text) - Val(Text26.text)) * 60 / (Text1(0).text * Text1(1).text * Text1(2).text * 1.2 * 1000 + 100000) Text98.text = Val(Text93.text) / 60000 + Val(Text98.text) Text99.text = Val(Text94.text) / 60000 + Val(Text99.text) Text100.text = Val(Text98.text) / Val(Text99.text) i = i + 1 Text92.text = Val(Text81.text) ElseIf Val(Text29.text) - Val(Combo6.text) < 0 And Val(Text29.text) - Val(Combo6.text) > -0.5 Then Text92.text = Val(Text78.text) Text93.text = Val(Text84.text) * Val(Text92.text) ^ 2 + Val(Text85.text) * Val(Text92.text) + Val(Text96.text) Text94.text = Val(Text86.text) * Val(Text92.text) + Val(Text87.text) newsheet.Cells(i, 1).Value = Text97.text newsheet.Cells(i, 2).Value = Text53.text newsheet.Cells(i, 3).Value = Text28.text newsheet.Cells(i, 4).Value = Text29.text newsheet.Cells(i, 5).Value = Text26.text newsheet.Cells(i, 6).Value = Text93.text newsheet.Cells(i, 7).Value = Text94.text newsheet.Cells(i, 8).Value = Text98.text newsheet.Cells(i, 9).Value = Text99.text newsheet.Cells(i, 10).Value = Text100.text newsheet.Cells(i, 11).Value = Fix(Text92.text + 0.5) Text29.text = Val(Text29.text) - (Val(Text93.text) - Val(Text26.text)) * 60 / (Text1(0).text * Text1(1).text * Text1(2).text * 1.2 * 1000 + 100000) Text98.text = Val(Text93.text) / 60000 + Val(Text98.text) Text99.text = Val(Text94.text) / 60000 + Val(Text99.text) Text100.text = Val(Text98.text) / Val(Text99.text) i = i + 1 Text92.text = Val(Text81.text) ElseIf Val(Text29.text) - Val(Combo6.text) < -0.5 Then Text92.text = 0 Text93.text = 0 Text94.text = 25 newsheet.Cells(i, 1).Value = Text97.text newsheet.Cells(i, 2).Value = Text53.text newsheet.Cells(i, 3).Value = Text28.text newsheet.Cells(i, 4).Value = Text29.text newsheet.Cells(i, 5).Value = Text26.text newsheet.Cells(i, 6).Value = Text93.text newsheet.Cells(i, 7).Value = Text94.text newsheet.Cells(i, 8).Value = Text98.text newsheet.Cells(i, 9).Value = Text99.text newsheet.Cells(i, 10).Value = Text100.text newsheet.Cells(i, 11).Value = Fix(Text92.text + 0.5) Text29.text = Val(Text29.text) - (Val(Text93.text) - Val(Text26.text)) * 60 / (Text1(0).text * Text1(1).text * Text1(2).text * 1.2 * 1000 + 100000) Text98.text = Val(Text93.text) / 60000 + Val(Text98.text) Text99.text = Val(Text94.text) / 60000 + Val(Text99.text) Text100.text = Val(Text98.text) / Val(Text99.text) i = i + 1 Text92.text = Val(Text81.text) Else Text92.text = Val(Text81.text) + 3 * (Val(Text29.text) - Val(Combo6.text)) Text93.text = Val(Text84.text) * Val(Text92.text) ^ 2 + Val(Text85.text) * Val(Text92.text) + Val(Text96.text) Text94.text = Val(Text86.text) * Val(Text92.text) + Val(Text87.text) newsheet.Cells(i, 1).Value = Text97.text newsheet.Cells(i, 2).Value = Text53.text newsheet.Cells(i, 3).Value = Text28.text newsheet.Cells(i, 4).Value = Text29.text newsheet.Cells(i, 5).Value = Text26.text newsheet.Cells(i, 6).Value = Text93.text newsheet.Cells(i, 7).Value = Text94.text newsheet.Cells(i, 8).Value = Text98.text newsheet.Cells(i, 9).Value = Text99.text newsheet.Cells(i, 10).Value = Text100.text newsheet.Cells(i, 11).Value = Fix(Text92.text + 0.5) Text29.text = Val(Text29.text) - (Val(Text93.text) - Val(Text26.text)) * 60 / (Text1(0).text * Text1(1).text * Text1(2).text * 1.2 * 1000 + 100000) Text98.text = Val(Text93.text) / 60000 + Val(Text98.text) Text99.text = Val(Text94.text) / 60000 + Val(Text99.text) Text100.text = Val(Text98.text) / Val(Text99.text) i = i + 1 Text92.text = Val(Text81.text) End If Loop n = n + 1 Text102.text = Text53.text Adodc6.Recordset.MoveNext Loop MsgBox "计算结束,请点击 计算数据读取 来查看结果"End Sub window任务栏添加程序图标 在VB中如何获取游戏中人物旁边的怪物坐标呀 请教这条update语句是否正确? 哥们给找一个使用coolbar的示例程序 急需,MKDIR的错误号 有关ADO的使用问题请教! 如果我使用ODBC的连接方式,没有任何grid控键,纯粹代码运行,如果获取查询后的数据集 关于项目方案的实现 请大家给我介绍几本关于OLE的书啊? 如何访问磁盘的指定磁道指定扇区? 设置FileList的文件过滤 为什么过滤不完全 从一个msflexgrid读取出多行的值到另一个msflexgrid中
Do While Not Adodc6.Recordset.EOF
j = 2 + 60 * n
Do Until i = j
If Val(Text29.text) - Val(Combo6.text) > 3 Then
If Abs(Val(Text53.text) - Val(Text102.text)) > 1 And Abs(Val(Text53.text) - Val(Text102.text)) <> 23 Then
Do Until Val(Text29.text) - Val(Combo6.text) < 1
Text92.text = Val(Text80.text)
Text93.text = Val(Text84.text) * Val(Text92.text) ^ 2 + Val(Text85.text) * Val(Text92.text) + Val(Text96.text)
Text94.text = Val(Text86.text) * Val(Text92.text) + Val(Text87.text)
newsheet.Cells(i, 1).Value = Text97.text
newsheet.Cells(i, 2).Value = Text53.text
newsheet.Cells(i, 3).Value = Text28.text
newsheet.Cells(i, 4).Value = Text29.text
newsheet.Cells(i, 5).Value = Text26.text
newsheet.Cells(i, 6).Value = Text93.text
newsheet.Cells(i, 7).Value = Text94.text
newsheet.Cells(i, 8).Value = Text98.text
newsheet.Cells(i, 9).Value = Text99.text
newsheet.Cells(i, 10).Value = Text100.text
newsheet.Cells(i, 11).Value = Fix(Text92.text + 0.5)
Text29.text = Val(Text29.text) - (Val(Text93.text) - Val(Text26.text)) * 60 / (Text1(0).text * Text1(1).text * Text1(2).text * 1.2 * 1000 + 100000)
Text98.text = Val(Text93.text) / 60000 + Val(Text98.text)
Text99.text = Val(Text94.text) / 60000 + Val(Text99.text)
Text100.text = Val(Text98.text) / Val(Text99.text)
i = i + 1
Text92.text = Val(Text81.text)
Loop
End If
Text92.text = Val(Text80.text)
Text93.text = Val(Text84.text) * Val(Text92.text) ^ 2 + Val(Text85.text) * Val(Text92.text) + Val(Text96.text)
Text94.text = Val(Text86.text) * Val(Text92.text) + Val(Text87.text)
newsheet.Cells(i, 1).Value = Text97.text
newsheet.Cells(i, 2).Value = Text53.text
newsheet.Cells(i, 3).Value = Text28.text
newsheet.Cells(i, 4).Value = Text29.text
newsheet.Cells(i, 5).Value = Text26.text
newsheet.Cells(i, 6).Value = Text93.text
newsheet.Cells(i, 7).Value = Text94.text
newsheet.Cells(i, 8).Value = Text98.text
newsheet.Cells(i, 9).Value = Text99.text
newsheet.Cells(i, 10).Value = Text100.text
newsheet.Cells(i, 11).Value = Fix(Text92.text + 0.5)
Text29.text = Val(Text29.text) - (Val(Text93.text) - Val(Text26.text)) * 60 / (Text1(0).text * Text1(1).text * Text1(2).text * 1.2 * 1000 + 100000)
Text98.text = Val(Text93.text) / 60000 + Val(Text98.text)
Text99.text = Val(Text94.text) / 60000 + Val(Text99.text)
Text100.text = Val(Text98.text) / Val(Text99.text)
i = i + 1
Text92.text = Val(Text81.text)
ElseIf Val(Text29.text) - Val(Combo6.text) < 0 And Val(Text29.text) - Val(Combo6.text) > -0.5 Then
Text92.text = Val(Text78.text)
Text93.text = Val(Text84.text) * Val(Text92.text) ^ 2 + Val(Text85.text) * Val(Text92.text) + Val(Text96.text)
Text94.text = Val(Text86.text) * Val(Text92.text) + Val(Text87.text)
newsheet.Cells(i, 1).Value = Text97.text
newsheet.Cells(i, 2).Value = Text53.text
newsheet.Cells(i, 3).Value = Text28.text
newsheet.Cells(i, 4).Value = Text29.text
newsheet.Cells(i, 5).Value = Text26.text
newsheet.Cells(i, 6).Value = Text93.text
newsheet.Cells(i, 7).Value = Text94.text
newsheet.Cells(i, 8).Value = Text98.text
newsheet.Cells(i, 9).Value = Text99.text
newsheet.Cells(i, 10).Value = Text100.text
newsheet.Cells(i, 11).Value = Fix(Text92.text + 0.5)
Text29.text = Val(Text29.text) - (Val(Text93.text) - Val(Text26.text)) * 60 / (Text1(0).text * Text1(1).text * Text1(2).text * 1.2 * 1000 + 100000)
Text98.text = Val(Text93.text) / 60000 + Val(Text98.text)
Text99.text = Val(Text94.text) / 60000 + Val(Text99.text)
Text100.text = Val(Text98.text) / Val(Text99.text)
i = i + 1
Text92.text = Val(Text81.text)
ElseIf Val(Text29.text) - Val(Combo6.text) < -0.5 Then
Text92.text = 0
Text93.text = 0
Text94.text = 25
newsheet.Cells(i, 1).Value = Text97.text
newsheet.Cells(i, 2).Value = Text53.text
newsheet.Cells(i, 3).Value = Text28.text
newsheet.Cells(i, 4).Value = Text29.text
newsheet.Cells(i, 5).Value = Text26.text
newsheet.Cells(i, 6).Value = Text93.text
newsheet.Cells(i, 7).Value = Text94.text
newsheet.Cells(i, 8).Value = Text98.text
newsheet.Cells(i, 9).Value = Text99.text
newsheet.Cells(i, 10).Value = Text100.text
newsheet.Cells(i, 11).Value = Fix(Text92.text + 0.5)
Text29.text = Val(Text29.text) - (Val(Text93.text) - Val(Text26.text)) * 60 / (Text1(0).text * Text1(1).text * Text1(2).text * 1.2 * 1000 + 100000)
Text98.text = Val(Text93.text) / 60000 + Val(Text98.text)
Text99.text = Val(Text94.text) / 60000 + Val(Text99.text)
Text100.text = Val(Text98.text) / Val(Text99.text)
i = i + 1
Text92.text = Val(Text81.text)
Else
Text92.text = Val(Text81.text) + 3 * (Val(Text29.text) - Val(Combo6.text))
Text93.text = Val(Text84.text) * Val(Text92.text) ^ 2 + Val(Text85.text) * Val(Text92.text) + Val(Text96.text)
Text94.text = Val(Text86.text) * Val(Text92.text) + Val(Text87.text)
newsheet.Cells(i, 1).Value = Text97.text
newsheet.Cells(i, 2).Value = Text53.text
newsheet.Cells(i, 3).Value = Text28.text
newsheet.Cells(i, 4).Value = Text29.text
newsheet.Cells(i, 5).Value = Text26.text
newsheet.Cells(i, 6).Value = Text93.text
newsheet.Cells(i, 7).Value = Text94.text
newsheet.Cells(i, 8).Value = Text98.text
newsheet.Cells(i, 9).Value = Text99.text
newsheet.Cells(i, 10).Value = Text100.text
newsheet.Cells(i, 11).Value = Fix(Text92.text + 0.5)
Text29.text = Val(Text29.text) - (Val(Text93.text) - Val(Text26.text)) * 60 / (Text1(0).text * Text1(1).text * Text1(2).text * 1.2 * 1000 + 100000)
Text98.text = Val(Text93.text) / 60000 + Val(Text98.text)
Text99.text = Val(Text94.text) / 60000 + Val(Text99.text)
Text100.text = Val(Text98.text) / Val(Text99.text)
i = i + 1
Text92.text = Val(Text81.text)
End If
Loop
n = n + 1
Text102.text = Text53.text
Adodc6.Recordset.MoveNext
Loop
MsgBox "计算结束,请点击 计算数据读取 来查看结果"
End Sub