Results 1 to 4 of 4

Thread: When do we need to use endif to end the conditional statement?

  1. #1
    Join Date
    Oct 2008
    Posts
    79

    When do we need to use endif to end the conditional statement?

    I just wanted to know what all things I need to know to think about the endif statement. When are you supposed to use endif to end the conditional statement. A conditional statement is a way for you to execute commands based on if a condition is true. It is easiest to understand by examples. Please let me know the suggestions for it.

  2. #2
    Join Date
    Jan 2006
    Posts
    6,878

    Re: When do we need to use endif to end the conditional statement?

    In the conditional statement "if", while at the time of closing the if condition we use the endif in the traditional way. If you want to execute more than one statement when a condition is true, you must put each statement on separate lines, and end the statement with the keyword "End If":

    Code:
    If i=10 Then
    msgbox "Hello"
    i = i+1
    End If

  3. #3
    Join Date
    Feb 2009
    Posts
    105

    Re: When do we need to use endif to end the conditional statement?

    A conditional statement is a way for you to execute commands based on if a condition is true. It is easiest to understand by examples. You can use the If...Then...ElseIf statement if you want to select one of many blocks of code to execute: In the Code Editor, click the arrow of the Object combo box and select Form. This tutorial relies on you understanding how variables work.

  4. #4
    Join Date
    Oct 2008
    Posts
    132

    Re: When do we need to use endif to end the conditional statement?

    The standard conditional statement: the value of the Boolean expression is evaluated. If the result is {true}, the first block of statements is executed, if the result is {false} the second block of statements is executed. For example if we set var1 = 5 and have the statement If var1 < 10 Then ... We can read it as follows if 5 is Less Than 10 - This would be true so our code gets executed.

Similar Threads

  1. Excel Macros for conditional formatting statement in Excel
    By Kungfu Pandey in forum Microsoft Project
    Replies: 1
    Last Post: 08-01-2012, 08:35 PM
  2. Dns delegation vs Conditional forwarding
    By aconti in forum Active Directory
    Replies: 4
    Last Post: 16-11-2009, 12:33 PM
  3. Conditional forwarder not resolving
    By dwiddifield in forum Networking & Security
    Replies: 0
    Last Post: 27-08-2009, 08:25 AM
  4. Conditional formatting in excel
    By RockeЯ in forum Windows Software
    Replies: 4
    Last Post: 27-06-2009, 12:06 PM
  5. Replies: 4
    Last Post: 25-02-2009, 08:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,755,048.92518 seconds with 17 queries