VBA Conditional Statement IF....THEN...ELSE
The IF THEN statement is used in Excel VBA to execute a command if a particular condition is met or not. With it you can redirect your user to different part of the Excel spreadsheet or make different actions depending on the inputs in the sheet. You can display a different information in a Cell depending on what is in another cell.
Here an easy example where when you have entered all the values in the cells B5 and B6, you press the OK button. This will display in F6 the cell that is bigger
If Range("B5").Value > Range("b6").Value Then
Range("F6").Value = "B5 is bigger"
Range("f6").Value = "B6 is bigger"
So you do not need to use the ELSE statement. You can just have a IF THEN statement if you need. Then you also do not need the END IF line.