Delete rows based on Cell Value using arrays in VBA

preview_player
Показать описание
Grab the Free VBA Quick Reference Guide
Delete Rows using an array
As in most coding languages, there are many ways to do something. In this video, we delete rows using an array. There are other methods to remove rows that are more efficient but you won't learn as much code!

In this video you will learn how to:

Transfer a range of data to an array using Current Region
Use an inputbox to that will be used as a criteria to remove rows
Use a For Loop to loop through the array
Use an If Statement combined with another For Loop to blank out the rows
You will then transfer the array back to the original range
And then we will sort the range to move all the zeroed out rows to the bottom
And to finish is off we will add some error handling
Below is the finalized code

Get the Code and Download the file here
Рекомендации по теме
Комментарии
Автор

Hi, thanks for video! But i am strugling with one case: deleting filtered rows in table. How to say to vba "you just filtered rows i need, now delete those, but not all rows and together all table"?.. :D i am stuck. Could you provide some ideas, please?

MultiDenisas
Автор

Hi, I have a task to delete in a range of 600. For eg I have about more than row of data. If is start from row 1-600 I would like to keep row 1 and delete all the way from 2 to 600, then keep 601 and delete all the way upto 1200. What should i write in a code to keep every first row of 600

dinyarbuhariwalla
Автор

i have 3 lakhs line, need to delete row based on array value . when i run its takes so much time and never end. I using screen updating, display alerts functions but even though its takes times. anyone pls

tamilheadsetd