From the course: Excel: Learning VBA

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Find values in cells

Find values in cells

- [Instructor] Some subroutines rely on your data containing a specific value. For example, you might want to return the date your company sold its first bottle of basil infused olive oil. You can press control F to use the fine dialog box through the user interface but you can also find values using VBA code, using the range objects find method. In this movie, I will show you two different ways to do that. My sample file is 05_03_Find, and you can find it in the Chapter Five folder of the "Exercise Files" collection. In this workbook, I have a small data list that shows the first day that a particular infusion of olive oil was sold. So we have our different infusions. So we have garlic, basil, mandarin, rosemary, and basil again. So, the goal is to create code that will find the first instance where basil was sold. I'll press Alt F11 to move to the Visual Basic editor. And you can see here that I have two separate…

Contents