# If Then Statement

## A collection of 8 posts

Below we will look at a program in Excel VBA that deletes blank cells. Situation: 1. First, we declare two variables of type Integer. One named counter and one named i. We initialize
23 October 2020
Below we will look at a program in Excel VBA that finds the second highest value. Situation: 1. First, we declare two Range objects and two variables of type Double. We call the
21 October 2020
The three most used logical operators in Excel VBA are: And, Or and Not. As always, we will use easy examples to make things more clear. Logical Operator And Place a command button
19 October 2020
The Mod operator in Excel VBA gives the remainder of a division. Place a command button on your worksheet and add the following code line: MsgBox 7 Mod 2 Result when you click
19 October 2020
Below we will look at a program in Excel VBA that checks whether a number is a prime number or not. Before you start: in mathematics, a prime number is a number that
18 October 2020
Instead of multiple If Then statements in Excel VBA, you can use the Select Case structure. Situation: Place a command button on your worksheet and add the following code lines: 1. First, declare
17 October 2020
Below we will look at a program in Excel VBA that calculates the tax on an income. The following tax rates apply to individuals who are residents of Australia. Taxable income Tax on
16 October 2020
Below we will look at a program in Excel VBA that sums numbers by color. Situation: You have lended money to two twelve people. Some people have given it back (in black) and
16 October 2020