From the course: Excel: Learning VBA

Unlock the full course today

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

Return part of a string

Return part of a string

- [Instructor] Even though most users think of Excel as a number crunching application, which it is, a surprising amount of your VBA code will have to deal with character strings. In this movie, I will show you how to assign parts of longer strings to a variable. I will also describe two new functions that were recently added to Excel that might replace what I show you in VBA. My sample file is "05_06_CutStrings" and you can find it in the Chapter 5 folder of the exercise files collection. Over on the left, I have a set of case codes in column A and those case codes referred to cases of olive oil and they're broken down into three bits of information. The first is the year, the second is a variety, and the third is the batch. And the idea is to find the year, variety, and batch as individual values and add them to columns B, C, and D in the workbook. I created some functions to illustrate the technique and what I'll…

Contents