From the course: Excel VBA: Managing Files and Data

Unlock this course with a free trial

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

Delete data from a list using DROP

Delete data from a list using DROP

- [Instructor] In the previous movie, I showed you how to use the TAKE function to bring row from a dataset to a different part of your worksheet. In this movie, I will show you how to perform similar actions using the DROP function, which is similar but has some distinct differences. My sample file is 08_05_Drop, and you can find it in the Chapter08 folder of the Exercise Files collection. Over on the left, I have a set of yearly sales data for the years 2018 through 2024. And then on the right, I have two different areas where I can paste the results of formulas. So let's start with a DROP formula. I'll click in cell D4, and what this will do is look at cells A4 through A10, which are our data we are excluding, the headers in row 3, and drop the two oldest rows, so 2018 and 2019. So in D4, I'll type =DROP drop the array, again A4 through B10, we're not including the headers, then a comma, and then the number of rows. The Excel team assumed that you'll want to drop the oldest values,…

Contents