

You should use matching End If statement after entering the above syntax, When the condition meets or criteria evaluates to true, then all the lines between If Then and End If are processed. IF THEN is a simple form of VBA statement. The format to write a code is: Now the blank module is created, it is also called a code window, where you can start writing if statement codes.Now go to the Insert menu from VBA window and select Module as shown below.

This will take us to Visual Basic coding window.Select or click on Visual Basic in the Code group on the Developer tab or you can directly click on Alt + F11 shortcut key. You can download this VBA IF Statements Excel Template here – VBA IF Statements Excel Template
