Thread: Double Delete
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
TGalin TGalin is offline
external usenet poster
 
Posts: 81
Default Double Delete

I have this macro

Dim myLastRow As Long
Dim r As Long
Dim c As Range
myLastRow = ActiveSheet.Cells(10000, 4).End(xlUp).Row
For r = myLastRow To 1 Step -1
Set c = ActiveSheet.Range("D" & r)
If c.Value = "Back" Then
c.EntireRow.Delete
End If
Next r

What can I add to this macro so that it in addition to deleting the entire
row if it finds "Back" in Column D, it also deletes the entire row above it?