VBA While Wend循环
2024-08-27 04:00:47
在While...Wend
循环中,如果条件为True
,则会执行所有语句,直到遇到Wend
关键字。
如果条件为false
,则退出循环,然后控件跳转到Wend
关键字后面的下一个语句。
语法
以下是VBA中While..Wend
循环的语法。
While condition(s)
[statements ]
[statements ]
...
[statements n]
Wend
流程图
示例
参考以下示例代码的实现 -
Private Sub Constant_demo_Click()
Dim Counter : Counter = While Counter < ' Test value of Counter.
Counter = Counter + ' Increment Counter.
msgbox "The Current Value of the Counter is : " & Counter
Wend ' While loop exits if Counter Value becomes 15.
End Sub
当上面的代码被执行时,它会在消息框中打印以下内容。
The Current Value of the Counter is : The Current Value of the Counter is : The Current Value of the Counter is : The Current Value of the Counter is : The Current Value of the Counter is :
最新文章
- REq,RES编码设置
- linux android真机测试
- sql 通过游标 拆分xml结构
- unity, 保存prefab时material丢失问题
- linux多线程编程(转)
- Javascript诞生与历史
- ASP.NET内置对象
- 学习日记-----ORM
- [React] Extracting Private React Components
- linux线程间同步方式汇总
- [ASP.NET]以iTextSharp手绘表格并产生PDF下载
- UNIX环境高级编程——非阻塞设置
- C# Unity的使用
- 后台文本编辑器KindEditor介绍
- 纯Css实现Div高度根据自适应宽度(百分比)调整
- 用Emacs看电影
- sgu 176 上下界网络流最小可行流带输出方案
- sqlserver流程控制(待续)
- redis的key
- Java接口获取系统配置信息