Delete Date Macro

  • Thread starter Thread starter Workbook
  • Start date Start date
W

Workbook

Any ideas about how to create a code so that every time the word “Dateâ€
appears in a cell in column A, the row that “Date†exists in will be deleted?
 
Sub DeleteDateInA()

FirstRow = 2 'Headings in row 1
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For r = LastRow To FirstRow Step -1
If Range("A" & r).Value = "Date" Then ' Date is the only word in the
cell
'If Range("A" & r).Value like "*Date*" Then ' * Allow text before and
after Date
Rows(r).Delete
End If
Next
End Sub

Hopes this helps
 
Back
Top