VBA - Filtering Data
It's a common mistake when we start using VBA to filter data by using long loops and conditions. This is probably the most logical way to interpret what we want to do. When we use loops and conditions we are taking to the code our natural process of filtering data. LOOK LINE BY LINE, AND IF A CONDITION IS MET, TAKE ACTION. Well yes, that works but it's not the optimal solution. Loops are great, I love them, but they are evil! They can slow down your process a lot when your data is considered big. Fortunately, we have a better "not that naturally logical" way to do it. FILTER! Like water and oil you can separate values and once you have them visible, take the desired action. Let's see it on the code: Ok, this wasn't that complicated. Let's see what we are doing here: 1- I'm selecting the Data that I want to filter. 2- I'm applying a filter to the 5th column of my Data, based on the Criteria "Bikes". 3- My Range show...