Skip to content

Estructuras de Control

If…Then…Else

asd
If <Condition> Then <Statements> Else <Statements> End If

If…Then…ElseIf

If <Condition> Then <Statements> Else If <Condition> Then <Statements> Else <Statements> End If

Select Case

Select Case <Variable> Case <VariableValue1> Statements Case <VariableValue2> Statements ... End Select

Choose

Sub Main MenuOption = 2 MsgBox "You chose " & Choose(MenuOption, "American", "Chinese", "Mexican", "German") End Sub

For…Next

Sub Main ' Create a variable to hold the result. Dim Total As Integer Total = 1 ' Define a counting variable. Dim Count As Integer ' Compute n! (factorial) for 5. For Count = 1 To 5 Total = Total * Count Next ' Display the result. MsgBox "The total is: " & Total End Sub

For…Next

For Each <Item> In <CollectionOrArray> <Statements> [Exit For] <Statements> Next


Do While. . .Loop ■ Do. . .Loop While ■ Do Until. . .Loop ■ Do. . .Loop Until

Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.