Formula for deleting a row when done with it.

April 4, 2011 at 10:28:19
Specs: Windows XP
I was wondering if there is a formula you can put in a cell that would make it delete an entire row simply by placing an X or something similar in a certain cell? EX- Row 1: there is info in each cell, from A to J. K is the COMPLETE column. I want to be able to type an X in the COMPLETE column that would delete the entire row 1, which I would be done with at that point. Is this possible?

See More: Formula for deleting a row when done with it.

Report •

#1
April 4, 2011 at 12:36:45
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

If Target.Column = 3 Then 'this would only work in column C, 4=d, 5=e, etc.
If LCase(Target.Value) = "x" Then
MsgBox "test delete row"
Application.Rows(Target.Row).Delete 'delete row
End If
End If

End Sub


Report •

#2
April 7, 2011 at 12:14:20
Above code goes in "ThisWorkbook", make adjustments as need
and K=11 'or Complete column

so use this line
If Target.Column = 11 Then 'this would only work in column C, 4=d, 5=e, etc.


Report •
Related Solutions


Ask Question