Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If...Then...Else in VBA
#1
Description:

The If statement checks a condition and executes a block of code if the condition is true.
If the condition is false, it can execute an alternative block (Else).

Example:

Sub ExampleIfThenElse()
    Dim age As Integer
    age = 25

    If age >= 18 Then
        MsgBox "You are an adult."
    Else
        MsgBox "You are a minor."
    End If
End Sub
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)