If Comparisons When making comparisons, we will usually use one of the comparison operators: Comparison Operator Explanation = Equal to <> Not Equal to > Greater than >= Greater than or Equal to < Less than &…
Read moreIf Then VBA If Statements allow you to test if expressions are TRUE or FALSE, running different code based on the results. Let’s look at a simple example: If Range("a2").Value > 10 Then Range("b2").Value = "Positive" This tests if the value in Range A2 is greater than 0. If so, setting Range B2 equal to “Positive” If…
Read moreThe VBA For Each Loop will loop through all objects in a collection: All cells in a range All worksheets in a workbook All shapes in a worksheet All open workbooks You can also use Nested For Each Loops to All cells in a range on all worksheets All shapes on all worksheets All sheets in all open workbooks The syntax is: For Each Object in …
Read more
Social Plugin