This ensures that there are no filters applied to other columns that could cause additional rows to be filtered out.Ī big thanks to Hoang for pointing this out on the YouTube video! The VBA Macro Code Important Note: I added a step to clear all filters in the range or Table at the beginning of the macro. It's a simple 2 or 3 step macro that will save time from doing this process manually. Checkout my article and video on how to copy & paste visible cells to learn more.įinally, the macro can also clear the filters so that you are left viewing the entire data range, minus the rows you've deleted. This is the same as using the Go To Special menu (keyboard shortcut Alt+ ) to select blanks. It uses the SpecialCells method to create a reference to the visible cells. Next, the macro simply deletes all of the visible rows that have been left by the filter. To remove the rows that have blank cells like this one, the macro first applies a filter to the product column. You can see one of those blank cells is E6. Then the macro deletes the visible cells in the range.īelow is an image of a data set that has some blank cells in column E (Product).The first step is to filter the rows based on filter criteria for the values to be deleted.VBA-Macro-to-Delete-Rows-Based-on-Cell-Value.zip Download Using a Macro to Delete Rows Based on Cell Valuesĭoes your data preparation process include deleting the same rows based on a condition? If so, you can use a macro to instantly delete any rows that have a particular value, date, or even blank cells.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |