Excel
Automatically Delete Rows Based On User Input
Ease of Use
Easy
Version tested with
2002
Submitted by:
Jacob Hilderbrand
Description:
This macro deletes an entire row based on a specific input.
Discussion:
You want to delete a row easily, and this macro allow just that. Input a "d" in Column C and that row is automatically deleted.
Code:
instructions for use
Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) If Not Target.Column = 3 Then Exit Sub End If If Target(1, 1).Value = "d" Then Target(1, 1).EntireRow.Delete End If End Sub
How to use:
Test the code:
Sample File:
DeleteRows.zip 6KB
Approved by mdmackillop
This entry has been viewed 236 times.
Please read our Legal Information and Privacy Policy Copyright @2004 - 2020 VBA Express