Do While Loop-VBA Excel - learnit

Home Top Ad

Post Top Ad

Wednesday, August 4, 2021

Do While Loop-VBA Excel

Do While Loop-VBA Excel

What is Excel VBA?

VBA stands for Visual Basic for Applications. Excel VBA is Microsoft is programming language for Excel and all the other Microsoft Office programs, like Word and PowerPoint. The Office suite programs all share a common programming language.


Why Use Excel VBA?

While users cannot directly manipulate the main Excel software through VBA, they can, however, master the art of making macros to optimize their time in Excel. There are two ways to make Excel macros.


The first method is to use the Macro Recorder. After activating the recorder, Excel will record all the steps a user makes and save it as a “process” known as a macro. When the user ends the recorder, this macro is saved and can be assigned to a button that will run the exact same process again when clicked. This method is relatively simple and requires no inherent knowledge of the VBA code. This method will work for simple processes.


Do While Loop

A ‘Do While’ loop allows you to check for a condition and run the loop while that condition is met (or is TRUE).


There are two types of syntax in the Do While Loop.


Sytnax
Do [While condition]
[Code block to Execute]
Loop


Sytnax
Do
[Code block to Execute]
Loop [While condition]


Example

Sub dowhileloop()
dim i as Integer
i=1
do while 1<=10
Cells(i,1)=i
i=i+1
Loop
End sub


Please Watching My Video is Below

No comments:

Post a Comment

Post Top Ad