今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Repeat a task using a Do loop
- [Instructor] When you create an Excel VBA subroutine, you expect it to perform a specific task. Sometimes though, you will want your VBA code to run until a condition is met. When you want a segment of your code to repeat until it encounters a specific condition, you can use the do loop construction. I'll demonstrate how to create the different kinds of do loops in this movie. My sample file is 03_03_DoLoops, and you can find it in the chapter three folder of the exercise files collection. In this workbook, I have two worksheets and on sheet one, which I've currently displayed, there is a form that is used as a suggestion box and you can see that it accepts the name, the email of the individual who is submitting the comment, and the text of their suggestion. That would be written to a collection table on sheet two. And you can see that I already have some data created on this worksheet. The goal would be to create a loop…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
Repeat a task using a For…Next loop5 分钟 6 秒
-
(已锁定)
Step through all items of a collection using a For…Each loop4 分钟 37 秒
-
(已锁定)
Repeat a task using a Do loop5 分钟 47 秒
-
(已锁定)
Execute code conditionally using an If…Then statement6 分钟 48 秒
-
(已锁定)
Select which action to take using a Case statement3 分钟 42 秒
-
(已锁定)
Challenge: Add logic to your code2 分钟 52 秒
-
(已锁定)
Solution: Add logic to your code4 分钟 40 秒
-
-
-
-
-
-