![]() Now again compile the code and run, if no error found. Step 9: Now to apply the Exit Sub in performed Do While loop we need to add Exit Sub statement before Do Loop start or after we defined variable A as shown below. Which means a value of A is less than 100 and formula which we defined in DO Loop says is the value of A is A + 1. We will see the message box has given us the output as 100. Later run the entire code by pressing the Play button located below the menu bar as shown below. Step 8: Now compile the code by pressing the F8 key to see if there is any bug in the code or not. For that insert MsgBox and give it to the variable A. Step 7: Now we will need a message box (Which is optional) to see the output of Do While loop. Which says DO Loop will run following the condition of A + 1 while A is less than 100. ![]() Step 6: Now how much we want to add +1 to A will be defined in Loop While condition. And run it till we get the +1 value for variable A. Which means DO Addition for A with its own value +1. Step 5: In between Do While we write a simple code of comparison.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |