From the course: Excel: Learning VBA

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Write a value to a cell

Write a value to a cell

- [Instructor] One way to display the results of a visual basic procedure is to write a value or values to one or more cells. In this movie, I will show you two ways to do that. My sample file is 05_01_Writing and you can find it in the chapter five folder of the exercise files collection. This workbook contains a single worksheet and I have two different sections for it. Over on the left you can see, that I have a list of different types in this case of olive oil, and then also unit sales. And that's just a total of the sales values. I'm going to use VBA to add another column header and that will expand the table. To move over to the Visual Basic Editor, I will press Alt F11 and I am in module one for my code. And I'll take a look at the code module or procedure that is on top. It's called write value, and what it does stepping through, is to take the string address of D6 and then write the word commission as the value…

Contents