Grow your YouTube channel like a PRO with a free tool
Get Free YouTube Subscribers, Views and Likes

VBA Macro to Delete Rows Based on Cell Values

Follow
Excel Campus - Jon

Sign up for our Excel webinar, times added weekly: https://www.excelcampus.com/blueprint...

In this video I explain how to use VBA to delete rows based on cell values or conditions. Download the Excel file that contains the sample code: https://www.excelcampus.com/vba/delet...

This is a simple two step process to apply a filter to a range or Table, then delete the visible rows. In the video I explain the VBA code to automate the process with a macro.

I also share more a few advanced macros that:
1. Display a message box with the number of rows to be deleted.
2. Apply filters to multiple columns to delete cells based on multiple conditions or criteria.

To filter the range or Table we use the AutoFilter method in VBA.

We then use the SpecialCells method to select the visible cells and delete the entire rows from the range.

***Free webinar on Macros & VBA***

If you're new to macros and/or want to learn more, join me for a free upcoming webinar on "The 7 Steps to Getting Started with VBA".

You will learn how to write your first macro and go beyond the limitations of the macro recorder.

Click here to register: https://www.excelcampus.com/macroswe...

****************************************************************

Here are some links and resources:

Articles on the AutoFilter method in VBA: https://www.excelcampus.com/vba/macro...

Video on how to copy & paste visible cells only:    • Copy & Paste Visible Cells Only in Ex...  

Delete entire blank rows:    • How to Delete Blank Rows in Excel  

Copy and paste to another workbook with VBA:    • VBA Macro to Copy Data from Another W...  

Add a Yes/No message box before a macro runs:    • How to Add a Yes No Popup Message Bo...  
00:00 Introduction
00:10 VBA Macro to Delete Rows Based on Cell Values
01:01 The Process Explained
05:43 The VBA Macro Code

posted by alcala947i