·  VB – Syntax – Conditional Statements – If...Then

 

- Info:

  - This tutorial shows how to use If...Then conditional statements.

 

- Procedure:

  - Create VB Application Test.vb

 

    Test.vb

    Sub Main()

      

      value = 10

      text  = "bird"

    

      'if...then in single line.

      If value = 10 Then MsgBox ("Value = 10") 'End If is not allowed here

    

      'if...then in multiple lines.

      If text = "bird" Then

        MsgBox ("text equals bird")

      End If

    

    End Sub